Branch: Tag:

1998-05-14

1998-05-14 15:58:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Some fixes in the MV support.

Rev: server/modules/filesystems/filesystem.pike:1.37

8:   inherit "roxenlib";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.36 1998/05/14 08:22:52 neotron Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.37 1998/05/14 15:58:34 grubba Exp $";   constant thread_safe=1;      
515:    break;       case "MV": -  // This little kludge is used by ftp2 to move files. +  // This little kluge is used by ftp2 to move files.       if(!QUERY(put))    {
530:    return 0;    }    -  if(size == -2) +  if(size < -1)    {    id->misc->error_code = 405;    TRACE_LEAVE("MV: Cannot overwrite directory");
561:    }    // #endif    -  if (QUERY(no_symlinks) && (contains_symlinks(path, oldf)) && -  (contains_symlinks(path, id->misc->move_from))) { +  if (QUERY(no_symlinks) && +  ((contains_symlinks(path, oldf)) || +  (contains_symlinks(path, id->misc->move_from)))) {    privs = 0;    errors++;    TRACE_LEAVE("MV: Contains symlinks. Permission denied");
571:       TRACE_ENTER("MV: Accepted", 0);    -  +     /* Clear the stat-cache for this file */   #ifdef __NT__    if(movefrom[-1] == '/')
581:    cache_set("stat_cache", movefrom, 0);    cache_set("stat_cache", f, 0);    } -  werror("Moving file "+movefrom+" to "+ f+"\n"); + #ifdef DEBUG +  report_notice("Moving file "+movefrom+" to "+ f+"\n"); + #endif /* DEBUG */ +     int code = mv(movefrom, f);    privs = 0;   
593:    return 0;    }    TRACE_LEAVE("MV: Success"); +  TRACE_LEAVE("Success");    return http_string_answer("Ok");       case "DELETE":