Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:167:   /*    * The privilege changer. Works like a mutex lock, but changes the UID/GID    * while held. Blocks all threads.    *    * Based on privs.pike,v 1.36.    */   int privs_level;      protected class Privs   { - #if efun(seteuid) + #if constant(seteuid)       int saved_uid;    int saved_gid;       int new_uid;    int new_gid;      #define LOGP (variables && variables->audit && variables->audit->query())      #if constant(geteuid) && constant(getegid) && constant(seteuid) && constant(setegid)
Roxen.git/server/base_server/roxen.pike:277: Inside #if defined(HAVE_EFFECTIVE_USER)
   }    }       if(LOGP)    report_notice(LOC_M(1, "Change to %s(%d):%d privs wanted (%s), from %s"),    (string)u[0], (int)uid, (int)gid,    (string)reason,    (string)dbt(backtrace()[-2]));       if (u[2]) { - #if efun(cleargroups) + #if constant(cleargroups)    if (mixed err = catch { cleargroups(); })    master()->handle_error (err);   #endif /* cleargroups */ - #if efun(initgroups) + #if constant(initgroups)    if (mixed err = catch { initgroups(u[0], u[3]); })    master()->handle_error (err);   #endif    }    gid = gid || getgid();    int err = (int)setegid(new_gid = gid);    if (err < 0) {    report_warning(LOC_M(2, "Privs: WARNING: Failed to set the "    "effective group id to %d!\n"    "Check that your password database is correct "
Roxen.git/server/base_server/roxen.pike:396: Inside #if defined(HAVE_EFFECTIVE_USER) and #if defined(PRIVS_DEBUG)
   int gid = getegid();    if (gid != new_gid) {    report_debug("Privs: GID #%d differs from expected #%d\n"    "%s\n",    gid, new_gid, describe_backtrace(backtrace()));    }   #endif /* PRIVS_DEBUG */       seteuid(0);    array u = getpwuid(saved_uid); - #if efun(cleargroups) + #if constant(cleargroups)    if (mixed err = catch { cleargroups(); })    master()->handle_error (err);   #endif /* cleargroups */    if(u && (sizeof(u) > 3)) {    if (mixed err = catch { initgroups(u[0], u[3]); })    master()->handle_error (err);    }    setegid(saved_gid);    seteuid(saved_uid);    enable_coredumps(1);   #endif /* HAVE_EFFECTIVE_USER */    } - #else /* efun(seteuid) */ + #else /* constant(seteuid) */    void create(string reason, int|string|void uid, int|string|void gid){} - #endif /* efun(seteuid) */ + #endif /* constant(seteuid) */   }      /* Used by read_config.pike, since there seems to be problems with    * overloading otherwise.    */   protected Privs PRIVS(string r, int|string|void u, int|string|void g)   {    return Privs(r, u, g);   }   
Roxen.git/server/base_server/roxen.pike:5662: Inside #if undefined(__NT__)
  #ifndef __NT__    if(getuid())    {    report_debug("It is impossible to chroot() if the server is not run as root.\n");    return;    }       if(!chroot(to))    {    report_debug("Roxen: Cannot chroot to "+to+": "); - #if efun(real_perror) + #if constant(real_perror)    real_perror();   #endif    return;    }    report_debug("Root is now "+to+".\n");   #endif   }      void create_pid_file(string where)   {
Roxen.git/server/base_server/roxen.pike:5720: Inside #if undefined(__NT__)
   })    report_debug("Cannot create the pid file %O: %s",    where, describe_error (err));   #endif   }      Pipe.pipe shuffle(Stdio.File from, Stdio.File to,    Stdio.File|void to2,    function(:void)|void callback)   { - #if efun(spider.shuffle) + #if constant(spider.shuffle)    if(!to2)    {    object p = fastpipe( );    p->input(from);    p->set_done_callback(callback);    p->output(to);    return p;    } else {   #endif    // 'fastpipe' does not support multiple outputs.    Pipe.pipe p = Pipe.pipe();    if (callback) p->set_done_callback(callback);    p->output(to);    if(to2) p->output(to2);    p->input(from);    return p; - #if efun(spider.shuffle) + #if constant(spider.shuffle)    }   #endif   }      // Dump all threads to the debug log.   void describe_all_threads (void|int ignored, // Might be the signal number.    void|object threads_disabled)   {    if (!threads_disabled)    // Disable all threads to avoid potential locking problems while we
Roxen.git/server/base_server/roxen.pike:6076:    argc = sizeof(argv);       fonts = ((program)"base_server/fonts.pike")();       DDUMP( "languages/abstract.pike" );    initiate_languages(query("locale"));       cache_clear_deltas();    set_locale();    - #if efun(syslog) + #if constant(syslog)    init_logger();   #endif    init_garber();       initiate_supports();    initiate_argcache();    init_configuserdb();    cache.init_session_cache();       protocols = build_protocols_mapping();