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.88 2000/08/28 09:54:35 jhs Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.89 2000/09/05 15:06:41 per Exp $";   constant thread_safe=1;      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>      #if DEBUG_LEVEL > 20   # ifndef FILESYSTEM_DEBUG   # define FILESYSTEM_DEBUG
Roxen.git/server/modules/filesystems/filesystem.pike:608:    QUOTA_WERR("Checking quota.\n");    if (id->misc->quota_obj && (id->misc->len > 0) &&    !id->misc->quota_obj->check_quota(URI, id->misc->len)) {    errors++;    report_warning("Creation of " + f + " failed. Out of quota.\n");    TRACE_LEAVE("PUT: Out of quota.");    return http_low_answer(413, "<h2>Out of disk quota.</h2>",    "413 Out of disk quota");    }    -  object privs; +        if (((int)id->misc->uid) && ((int)id->misc->gid)) {    // NB: Root-access is prevented.    privs=Privs("Saving file", (int)id->misc->uid, (int)id->misc->gid );    }       if (QUERY(no_symlinks) && (contains_symlinks(path, oldf))) {    privs = 0;    errors++;    report_error("Creation of " + f + " failed. Permission denied.\n");
Roxen.git/server/modules/filesystems/filesystem.pike:716:    TRACE_LEAVE("CHMOD of internal file is disallowed");    return 0;    }       if(QUERY(check_auth) && (!id->auth || !id->auth[0])) {    TRACE_LEAVE("CHMOD: Permission denied");    return Roxen.http_auth_required("foo",    "<h1>Permission to 'CHMOD' files denied</h1>");    }    -  object privs; +        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 );    }       if (QUERY(no_symlinks) && (contains_symlinks(path, oldf))) {    privs = 0;    errors++;    TRACE_LEAVE("CHMOD: Contains symlinks. Permission denied");
Roxen.git/server/modules/filesystems/filesystem.pike:798:    return 0;    }       if (FILTER_INTERNAL_FILE (movefrom, id) ||    FILTER_INTERNAL_FILE (f, id)) {    id->misc->error_code = 405;    TRACE_LEAVE("MV to or from internal file is disallowed");    return 0;    }    -  object privs; -  +     if (((int)id->misc->uid) && ((int)id->misc->gid)) {    // NB: Root-access is prevented.    privs=Privs("Moving file", (int)id->misc->uid, (int)id->misc->gid );    }       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");    return http_low_answer(403, "<h2>Permission denied.</h2>");    }    -  int code = mv(decode_path(movefrom), decode_path(f)); +  code = mv(decode_path(movefrom), decode_path(f));    privs = 0;       moves++;       TRACE_ENTER("MV: Accepted", 0);       /* Clear the stat-cache for this file */    if (stat_cache) {    cache_set("stat_cache", movefrom, 0);    cache_set("stat_cache", f, 0);
Roxen.git/server/modules/filesystems/filesystem.pike:901:    return 0;    }       if(size < -1)    {    id->misc->error_code = 405;    TRACE_LEAVE("MOVE: Cannot overwrite directory");    return 0;    }    -  object privs; +     if (((int)id->misc->uid) && ((int)id->misc->gid)) {    // NB: Root-access is prevented.    privs=Privs("Moving file", (int)id->misc->uid, (int)id->misc->gid );    }       if (QUERY(no_symlinks) &&    ((contains_symlinks(path, f)) ||    (contains_symlinks(path, moveto)))) {    privs = 0;    errors++;    TRACE_LEAVE("MOVE: Contains symlinks. Permission denied");    return http_low_answer(403, "<h2>Permission denied.</h2>");    }    -  int code = mv(decode_path(f), decode_path(moveto)); +  code = mv(decode_path(f), decode_path(moveto));    privs = 0;       TRACE_ENTER("MOVE: Accepted", 0);       moves++;       /* Clear the stat-cache for this file */    if (stat_cache) {    cache_set("stat_cache", moveto, 0);    cache_set("stat_cache", f, 0);