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 - 2000, 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.96 2001/03/08 14:35:42 per Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.97 2001/03/15 23:31:25 per 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:542:    TRACE_LEAVE("MKDIR disallowed (since PUT is disallowed)");    return 0;    }       if (FILTER_INTERNAL_FILE (f, id)) {    id->misc->error_code = 405;    TRACE_LEAVE("MKDIR disallowed (since the dir name matches internal file glob)");    return 0;    }    -  if(query("check_auth") && (!id->auth || !id->auth[0])) { +  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE("MKDIR: Permission denied");    return Roxen.http_auth_required("foo",    "<h1>Permission to 'MKDIR' denied</h1>");    }    mkdirs++;    object privs;       if (((int)id->misc->uid) && ((int)id->misc->gid)) {    // NB: Root-access is prevented.    privs=Privs("Creating directory",
Roxen.git/server/modules/filesystems/filesystem.pike:596:    TRACE_LEAVE("PUT disallowed");    return 0;    }       if (FILTER_INTERNAL_FILE (f, id)) {    id->misc->error_code = 405;    TRACE_LEAVE("PUT of internal file is disallowed");    return 0;    }    -  if(query("check_auth") && (!id->auth || !id->auth[0])) { +  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE("PUT: Permission denied");    return Roxen.http_auth_required("foo",    "<h1>Permission to 'PUT' files denied</h1>");    }       puts++;       QUOTA_WERR("Checking quota.\n");    if (id->misc->quota_obj && (id->misc->len > 0) &&    !id->misc->quota_obj->check_quota(URI, id->misc->len)) {
Roxen.git/server/modules/filesystems/filesystem.pike:715:    TRACE_LEAVE("CHMOD disallowed (since PUT is disallowed)");    return 0;    }       if (FILTER_INTERNAL_FILE (f, id)) {    id->misc->error_code = 405;    TRACE_LEAVE("CHMOD of internal file is disallowed");    return 0;    }    -  if(query("check_auth") && (!id->auth || !id->auth[0])) { +  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE("CHMOD: Permission denied");    return Roxen.http_auth_required("foo",    "<h1>Permission to 'CHMOD' files denied</h1>");    }          if (((int)id->misc->uid) && ((int)id->misc->gid)) {    // NB: Root-access is prevented.    privs=Privs("CHMODing file", (int)id->misc->uid, (int)id->misc->gid );    }
Roxen.git/server/modules/filesystems/filesystem.pike:781:    return 0;    }       if(size < -1)    {    id->misc->error_code = 405;    TRACE_LEAVE("MV: Cannot overwrite directory");    return 0;    }    -  if(query("check_auth") && (!id->auth || !id->auth[0])) { +  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE("MV: Permission denied");    return Roxen.http_auth_required("foo",    "<h1>Permission to 'MV' files denied</h1>");    }    string movefrom;    if(!id->misc->move_from ||    !(movefrom = id->conf->real_file(id->misc->move_from, id))) {    id->misc->error_code = 405;    errors++;    TRACE_LEAVE("MV: No source file");
Roxen.git/server/modules/filesystems/filesystem.pike:858:    TRACE_LEAVE("MOVE disallowed (since PUT is disallowed)");    return 0;    }    if(size != -1)    {    id->misc->error_code = 404;    TRACE_LEAVE("MOVE failed (no such file)");    return 0;    }    -  if(query("check_auth") && (!id->auth || !id->auth[0])) { +  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE("MOVE: Permission denied");    return Roxen.http_auth_required("foo",    "<h1>Permission to 'MOVE' files denied</h1>");    }       if(!sizeof(id->misc["new-uri"] || "")) {    id->misc->error_code = 405;    errors++;    TRACE_LEAVE("MOVE: No dest file");    return 0;
Roxen.git/server/modules/filesystems/filesystem.pike:957:    TRACE_LEAVE("DELETE: Disabled");    return 0;    }       if (FILTER_INTERNAL_FILE (f, id)) {    id->misc->error_code = 405;    TRACE_LEAVE("DELETE of internal file is disallowed");    return 0;    }    -  if(query("check_auth") && (!id->auth || !id->auth[0])) { +  if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE("DELETE: Permission denied");    return http_low_answer(403, "<h1>Permission to DELETE file denied</h1>");    }       if (query("no_symlinks") && (contains_symlinks(path, oldf))) {    errors++;    report_error(LOCALE(48,"Deletion of %s failed. Permission denied.\n"),f);    TRACE_LEAVE("DELETE: Contains symlinks");    return http_low_answer(403, "<h2>Permission denied.</h2>");    }