Ticket Change Details
Not logged in
Overview

Artifact ID: a24e6c20d97713dd69c8944623cb0d0593f9df68
Ticket: 2245a1e3d058d85ec59c327a932a208109d46d45
rm command mistakingly believes files are directories
User & Date: anonymous 2010-02-13 05:38:06
Changes

  1. comment changed to:
    <pre>
    'fossil rm file' crashes:
    (gdb) where
    #0  0x91af1e9a in closedir$UNIX2003 ()
    #1  0x00002d43 in del_directory_content (zDir=0x202b00 "mdb.mk") at add_.c:223
    #2  0x00002de9 in del_cmd () at add_.c:255
    #3  0x00022fb7 in main (argc=3, argv=0xbffff49c) at main_.c:258
    
    mdb.mk is a plain file
    
    Suggested patch:
    --- src/add.c
    +++ src/add.c
    @@ -249,11 +249,11 @@
       db_begin_transaction();
       for(i=2; i<g.argc; i++){
         char *zName;
     
         zName = mprintf("%/", g.argv[i]);
    -    if( file_isdir(zName) ){
    +    if( file_isdir(zName) == 1){
           del_directory_content(zName);
         } else {
           char *zPath;
           Blob pathname;
           file_tree_name(zName, &pathname, 1);
    </pre>
    
  2. foundin changed to: "95ae79d504"
  3. private_contact changed to: "e05c4b7600be973bfc338fbb2709b47357780bc8"
  4. severity changed to: "Important"
  5. status changed to: "Open"
  6. title changed to:
    rm command mistakingly believes files are directories
    
  7. type changed to: "Code_Defect"