X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=daemon.c;h=46eb8f19196acfe37f280eb6650223437acdbf1b;hp=d3a43b9a2de32fe50f2a42009cbcfb7830972985;hb=6693375b52f2712ace6dc50b717de9cb371a7c2a;hpb=5fde5b4d4abeb795f71101d1fd3524f8a27971eb diff --git a/daemon.c b/daemon.c index d3a43b9a..46eb8f19 100644 --- a/daemon.c +++ b/daemon.c @@ -101,18 +101,22 @@ void close_log(FILE* logfile) */ void log_welcome(const char *whoami, int loglevel) { - PARA_INFO_LOG("welcome to %s " VERSION " ("BUILD_DATE")\n", whoami); + PARA_INFO_LOG("welcome to %s " PACKAGE_VERSION " ("BUILD_DATE")\n", + whoami); PARA_DEBUG_LOG("using loglevel %d\n", loglevel); } /** * give up superuser privileges * + * \param username the user to switch to + * \param groupname the group to switch to + * * This function returns immediately if not invoked with EUID zero. Otherwise, * it tries to obtain the GID of \a groupname and the UID of \a username. On * success, effective and real GID/UID and the saved set-group-ID/set-user-ID - * are all set accordingly. On errors, an appropriate message is logged and exit() - * is called to terminate the process. + * are all set accordingly. On errors, an appropriate message is logged and + * exit() is called to terminate the process. * * \sa getpwnam(3), getuid(2), setuid(2), getgrnam(2), setgid(2) */ @@ -149,7 +153,6 @@ void para_drop_privileges(const char *username, const char *groupname) PARA_INFO_LOG("%s", "dropping root privileges\n"); setuid(p->pw_uid); PARA_DEBUG_LOG("uid: %d, euid: %d\n", getuid(), geteuid()); - setuid(p->pw_uid); } /**