Branch: Tag:

2001-09-27

2001-09-27 13:03:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Privs() is now a true noop if the uid has been changed permanently.

Rev: server/base_server/roxen.pike:1.743

6:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.742 2001/09/27 12:25:53 anders Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.743 2001/09/27 13:03:52 grubba Exp $";      // The argument cache. Used by the image cache.   ArgCache argcache;
156:       void create(string reason, int|string|void uid, int|string|void gid)    { +  // No need for Privs if the uid has been changed permanently. +  if(getuid()) return; +    #ifdef PRIVS_DEBUG    report_debug(sprintf("Privs(%O, %O, %O)\n"    "privs_level: %O\n",
174: Inside #if defined(HAVE_EFFECTIVE_USER)
      p_level = privs_level++;    -  if(getuid()) return; -  +     /* Needs to be here since root-priviliges may be needed to    * use getpw{uid,nam}.    */
283:       void destroy()    { +  // No need for Privs if the uid has been changed permanently. +  if(getuid()) return; +    #ifdef PRIVS_DEBUG    report_debug(sprintf("Privs->destroy()\n"    "privs_level: %O\n",
323: Inside #if defined(HAVE_EFFECTIVE_USER)
   };    }    -  if(getuid()) return; -  +    #ifdef PRIVS_DEBUG    int uid = geteuid();    if (uid != new_uid) {
4536:       string kmd5 = md5( pattern );    + #if 1    array tmp =    dbm_cached_get( "local" )    ->query("SELECT full,enc FROM compiled_formats WHERE md5=%s", kmd5 );
4550:    describe_backtrace(err));   // #endif    } + #endif /* 0 */          -  +     string code = "";    array variables = ({ " object userdb_module",    " object authmethod = id->conf",