Roxen.git / server / modules / filesystems / filesystem.pike

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:1:   // This is a roxen module. Copyright © 1996 - 2001, Roxen IS.      // This is a virtual "file-system".   // It will be located somewhere in the name-space of the server.   // Also inherited by some of the other filesystems.      inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.134 2004/05/10 14:46:39 grubba Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.135 2004/05/10 18:39:55 grubba Exp $";   constant thread_safe=1;      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>         //<locale-token project="mod_filesystem">LOCALE</locale-token>   #define LOCALE(X,Y) _DEF_LOCALE("mod_filesystem",X,Y)
Roxen.git/server/modules/filesystems/filesystem.pike:1270:    }    if(!query("delete"))    {    privs = 0;    id->misc->error_code = 405;    TRACE_LEAVE("MOVE disallowed (DELE disabled)");    return 0;    }       if ((overwrite == DO_OVERWRITE) || (size > -1)) { -  int code = recurse_delete_files(new_uri, +  mapping(string:mixed) res = +  recurse_delete_files(new_uri,    id->get_multi_status()-> -  prefix(id->url_base() + -  mountpoint[1..]), id); -  if (code > 1) { +  prefix(id->url_base() + mountpoint[1..]), id); +  if (res && res->error >= 300) {    privs = 0;    TRACE_LEAVE("MOVE: Recursive delete failed.");    return Roxen.http_status(412);    }    } else {    privs = 0;    TRACE_LEAVE("MOVE: Cannot overwrite directory");    return Roxen.http_status(412);    }    }
Roxen.git/server/modules/filesystems/filesystem.pike:1358:    TRACE_LEAVE(sprintf("DELETE: Bad depth header: %O.",    id->request_headers->depth));    return http_low_answer(400, "<h2>Unsupported depth.</h2>");    }       if (size < 0) {    mapping|int(0..1) res;    if (mappingp(res = write_access(combine_path(oldf, "../"), 1, id)) ||    (res && mappingp(res = write_access(oldf, 1, id)))) {    SIMPLE_TRACE_LEAVE("DELETE: Recursive write access denied."); -  id->set_status_for_path(query_location()+oldf, res->error); -  return 0; +  return res;    }    report_notice(LOCALE(64,"DELETING the directory %s.\n"), f);       accesses++;       SETUID_TRACE("Deleting directory", 0);       int start_ms_size = id->multi_status_size();    recursive_rm(f, query_location() + oldf, res, id);       if (!rm(f)) {    if (id->multi_status_size() > start_ms_size) {   #if constant(system.EEXIST)    if (errno() != system.EEXIST)   #endif    { -  id->set_status_for_path(query_location() + oldf, 403); +  return Roxen.http_status(403); +  //id->set_status_for_path(query_location() + oldf, 403);    }    } else {    TRACE_LEAVE("DELETE: Failed to delete directory.");    return http_low_answer(403, "<h2>Failed to delete directory.</h2>");    }    }       if (id->multi_status_size() > start_ms_size) {    TRACE_LEAVE("DELETE: Partial failure.");    return ([]);    }    } else {    mapping|int(0..1) res;    if ((res = write_access(combine_path(oldf, "../"), 0, id)) ||    (res = write_access(oldf, 0, id))) {    SIMPLE_TRACE_LEAVE("DELETE: Write access denied."); -  id->set_status_for_path(query_location()+oldf, res->error); -  return 0; +  return res;    }       report_notice(LOCALE(49,"DELETING the file %s.\n"),f);       accesses++;       /* Clear the stat-cache for this file */    if (stat_cache) {    cache_set("stat_cache", f, 0);    }