From: Andre Date: Sat, 16 Sep 2006 22:01:31 +0000 (+0200) Subject: daemon.c: para_drop_privileges: kill duplicate call to setuid() X-Git-Tag: v0.2.14~14 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=10aa048801a707c80776f606d50a3bbb7c4a9192;ds=sidebyside daemon.c: para_drop_privileges: kill duplicate call to setuid() Also add missing documentation of the parameters of this function. --- diff --git a/daemon.c b/daemon.c index edaf7f9c..46eb8f19 100644 --- a/daemon.c +++ b/daemon.c @@ -109,11 +109,14 @@ void log_welcome(const char *whoami, int 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) */ @@ -150,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); } /**