Branch: Tag:

1997-10-11

1997-10-11 20:54:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Privs now released somewhat earlier.

Rev: server/modules/filesystems/filesystem.pike:1.24

4:   // 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.23 1997/09/17 00:44:08 grubba Exp $"; + string cvs_version= "$Id: filesystem.pike,v 1.24 1997/10/11 20:54:21 grubba Exp $";   int thread_safe=1;      
138:      mixed stat_file( mixed f, mixed id )   { +  array fs; +  if(stat_cache && !id->pragma["no-cache"] && +  (fs=cache_lookup("stat_cache",path+f))) +  return fs; +     object privs;       if (((int)id->misc->uid) && ((int)id->misc->gid) &&
145:    // NB: Root-access is prevented.    privs=Privs("Statting file", (int)id->misc->uid, (int)id->misc->gid );    } +  fs = file_stat(path + f); /* No security currently in this function */ +  privs = 0;    if(!stat_cache) -  return file_stat(path + f); /* No security currently in this function */ -  array fs; -  if(!id->pragma["no-cache"]&&(fs=cache_lookup("stat_cache",path+f))) +     return fs; -  fs = file_stat(path+f); -  cache_set("stat_cache",path+f,fs); +  cache_set("stat_cache", path+f, fs);    return fs;   }   
183:    privs=Privs("Getting dir", (int)id->misc->uid, (int)id->misc->gid );    }    -  if(!(dir = get_dir( path + f ))) +  if(!(dir = get_dir( path + f ))) { +  privs = 0;    return 0; -  +  }       privs = 0;   
361:    }       if (QUERY(no_symlinks) && (contains_symlinks(path, oldf))) { +  privs = 0;    errors++;    report_error("Creation of " + f + " failed. Permission denied.\n");    return http_low_answer(403, "<h2>Permission denied.</h2>");
420:       if(!rm(f))    { +  privs = 0;    id->misc->error_code = 405;    return 0;    } -  +  privs = 0;    deletes++;    return http_low_answer(200,(f+" DELETED from the server"));