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.142 2004/05/13 18:20:39 grubba Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.143 2004/05/13 21:00:07 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:1236:       // FIXME: The code below doesn't allow for this module being overloaded.    if (!has_prefix(new_uri, mountpoint)) {    id->misc->error_code = 405;    TRACE_LEAVE("MOVE: Dest file on other filesystem.");    return(0);    }    new_uri = new_uri[sizeof(mountpoint)..];    string moveto = path + "/" + new_uri;    +  // Workaround for Linux, Tru64 and FreeBSD. +  if (has_suffix(moveto, "/")) { +  moveto = moveto[..sizeof(moveto)-2]; +  } +     if (FILTER_INTERNAL_FILE (f, id) ||    FILTER_INTERNAL_FILE (moveto, id)) {    id->misc->error_code = 405;    TRACE_LEAVE("MOVE to or from internal file is disallowed");    return 0;    }       if (query("no_symlinks") &&    ((contains_symlinks(path, f)) ||    (contains_symlinks(path, moveto)))) {
Roxen.git/server/modules/filesystems/filesystem.pike:1597:    report_warning(LOCALE(47,"Creation of %O failed. Out of quota.\n"),    dest_path);    TRACE_LEAVE("PUT: Out of quota.");    return Roxen.http_status(507, "Out of disk quota.");    }    object source_file = open(source_path, "r");    if (!source_file) {    TRACE_LEAVE("Failed to open source file.");    return Roxen.http_status(404);    } -  // Workaround for Linux, Tru64 and FreeBSD not being POSIX. +  // Workaround for Linux, Tru64 and FreeBSD.    if (has_suffix(dest_path, "/")) {    dest_path = dest_path[..sizeof(dest_path)-2];    }    object privs;    SETUID_TRACE("COPY: Copying file.", 0);    object dest_file = open(dest_path, "cwt");    privs = 0;    if (!dest_file) {    return errno_to_status (errno(), 1, id);    }