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.125 2004/04/20 15:26:16 grubba Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.126 2004/04/20 21:10:46 mast 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:679:    return 0;   }      mixed find_file( string f, RequestID id )   {    TRACE_ENTER("find_file(\""+f+"\")", 0);    object o;    int size;    string tmp;    string oldf = f; +  object privs; +  int code;       FILESYSTEM_WERR("Request for \""+f+"\"" +    (id->misc->internal_get ? " (internal)" : ""));       /* only used for the quota system, thus rather unessesary to do for    each request....    */   #define URI combine_path(mountpoint + "/" + oldf, ".")       string norm_f;
Roxen.git/server/modules/filesystems/filesystem.pike:771:    }    if (FILTER_INTERNAL_FILE (f, id))    {    TRACE_LEAVE ("Is internal file");    return 0;    }    }       TRACE_ENTER("Opening file \"" + f + "\"", 0);    -  object privs; +     SETUID_TRACE("Open file", 1);       o = Stdio.File( );    if(!o->open(norm_f, "r" )) o = 0;    privs = 0;       if(!o || (no_symlinks && (contains_symlinks(path, oldf))))    {    errors++;    report_error(LOCALE(45,"Open of %s failed. Permission denied.\n"),f);
Roxen.git/server/modules/filesystems/filesystem.pike:851:    return 0;    }       if(query("check_auth") && (!id->conf->authenticate( id ) ) ) {    TRACE_LEAVE(sprintf("%s: Permission denied", id->method));    return Roxen.http_auth_required("foo",    sprintf("<h1>Permission to '%s' denied</h1>",    id->method));    }    mkdirs++; -  object privs; +     SETUID_TRACE("Creating directory/collection", 0);       if (query("no_symlinks") && (contains_symlinks(path, oldf))) {    privs = 0;    errors++;    report_error(LOCALE(46,"Creation of %s failed. Permission denied.\n"),    oldf);    TRACE_LEAVE(sprintf("%s: Contains symlinks. Permission denied",    id->method));    return http_low_answer(403, "<h2>Permission denied.</h2>");    }    -  int code = mkdir(f); +  code = mkdir(f);    int err_code = errno();    privs = 0;       TRACE_ENTER(sprintf("%s: Accepted", id->method), 0);       if (code) {    chmod(f, 0777 & ~(id->misc->umask || 022));    TRACE_LEAVE(sprintf("%s: Success", id->method));    TRACE_LEAVE("Success");    if (id->method == "MKCOL") {