Branch: Tag:

1997-03-26

1997-03-26 05:54:17 by Per Hedbor <ph@opera.com>

Fixes to support the newest pike

Rev: server/base_server/cache.pike:1.11
Rev: server/base_server/config/builders.pike:1.5
Rev: server/base_server/config/describers.pike:1.21
Rev: server/base_server/config/low_describers.pike:1.6
Rev: server/base_server/configuration.pike:1.19
Rev: server/base_server/mainconfig.pike:1.36
Rev: server/base_server/module.pike:1.12
Rev: server/base_server/persistent.pike:1.16
Rev: server/base_server/roxen.pike:1.46
Rev: server/base_server/roxenlib.pike:1.19
Rev: server/base_server/roxenloader.pike:1.11
Rev: server/etc/extensions:1.4
Rev: server/etc/include/module.h:1.7
Rev: server/etc/roxen_master.pike:1.29
Rev: server/etc/supports:1.14
Rev: server/modules/directories/directories.pike:1.9
Rev: server/modules/directories/fastdir.pike:1.7
Rev: server/modules/filesystems/filesystem.pike:1.11
Rev: server/modules/filesystems/userfs.pike:1.11
Rev: server/modules/filters/hostredirect.pike:1.8
Rev: server/modules/filters/redirect.pike:1.7
Rev: server/modules/filters/relay.pike:1.6
Rev: server/modules/graphics/graphic_text.pike:1.39
Rev: server/modules/misc/userdb.pike:1.11
Rev: server/modules/scripting/cgi.pike:1.13
Rev: server/modules/scripting/pikescript.pike:1.9
Rev: server/modules/tags/htmlparse.pike:1.25
Rev: server/protocols/http.pike:1.21

3:   // 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. - string cvs_version = "$Id: filesystem.pike,v 1.10 1997/02/14 03:42:57 per Exp $"; +  + string cvs_version= "$Id: filesystem.pike,v 1.11 1997/03/26 05:54:10 per Exp $"; +    #include <module.h>   #include <stat.h>   
67:    "If set, files ending with '~' or '#' or '.bak' will "+    "be shown in directory listings");    -  defvar("put", 1, "Handle the 'PUT' method", TYPE_FLAG, +  defvar("put", 1, "Handle the PUT method", TYPE_FLAG,    "If set, PUT can be used to upload files to the server.");    -  defvar("delete", 0, "Handle the 'DELETE' method", TYPE_FLAG, +  defvar("delete", 0, "Handle the DELETE method", TYPE_FLAG,    "If set, DELETE can be used to delete files from the "    "server.");   
275:       case "PUT":    if(!QUERY(put)) +  { +  id->misc->error_code = 405;    return 0; -  +  }       if(QUERY(check_auth) && (!id->auth || !id->auth[0])) -  return http_auth_required("foo","<h1>Permission to 'PUT' files denied</h1>"); -  +  return http_auth_required("foo", +  "<h1>Permission to 'PUT' files denied</h1>");    puts++;    - #if 0 -  perror("PUT "+id->not_query+" ; "+id->misc->len+" bytes for "+ -  id->misc->gecos+" (uid="+id->misc->uid+"; gid="+id->misc->gid+")\n"); - #endif - #if efun(geteuid) -  int ouid, ogid, dosetuid; -  if(id->misc->uid && !getuid()) // We want to create the files -  // with the correct uid/gid. -  { -  dosetuid = 1; ouid = geteuid(); ogid = getegid(); -  seteuid(getuid()); -  setegid( (int)id->misc->gid ); - #if efun(initgroups) -  initgroups( id->auth[1], (int)id->misc->gid ); - #endif -  seteuid( (int)id->misc->uid ); -  } - #endif +  object privs; +  +  if(id->misc->uid) +  privs=((program)"privs")("Saving file", id->misc->uid, id->misc->gid ); +     rm( f );    mkdirhier( f );    object to = open(f, "wc"); - #if efun(geteuid) -  if(dosetuid) -  { -  array ou; -  ou = roxen->user_from_uid( ouid, id ); -  seteuid(0); - #if efun(initgroups) -  if(ou) initgroups( ou[0], ogid ); - #endif -  seteuid( ouid ); -  setegid( ogid ); -  } - #endif +        if(!to) -  +  { +  id->misc->error_code = 403;    return 0; -  +  }       putting[id->my_fd]=id->misc->len;    if(id->data && strlen(id->data))
338:       case "DELETE":    if(!QUERY(delete) || size==-1) +  { +  id->misc->error_code = 405;    return 0; -  +  }    if(QUERY(check_auth) && !id->misc->auth_ok)    return http_low_answer(403, "<h1>Permission to DELETE file denied</h1>");    -  deletes++; +     report_error("DELETING the file "+f+"\n");    accesses++; -  rm(f); +  +  if(id->misc->uid) +  privs=((program)"privs")("Saving file", id->misc->uid, id->misc->gid ); +  +  if(!rm(f)) +  { +  id->misc->error_code = 405; +  return 0; +  } +  deletes++;    return http_low_answer(200,(f+" DELETED from the server"));       default: