X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=daemon.c;h=ae183d8edad65b0d20fdd7cc2fa4c332d8401564;hp=3bcb6e019a442ddf7a8709759937a7d2bd603bf6;hb=1f132af229ff899aae357ee75a3b8e7b4bd061bd;hpb=bd55215eb1f1c8d041170743dcee5e069d5706b8 diff --git a/daemon.c b/daemon.c index 3bcb6e01..ae183d8e 100644 --- a/daemon.c +++ b/daemon.c @@ -269,7 +269,11 @@ void drop_privileges_or_die(const char *username, const char *groupname) exit(EXIT_FAILURE); } PARA_INFO_LOG("dropping root privileges\n"); - setuid(p->pw_uid); + if (setuid(p->pw_uid) < 0) { + PARA_EMERG_LOG("failed to set effective user ID (%s)", + strerror(errno)); + exit(EXIT_FAILURE); + } PARA_DEBUG_LOG("uid: %d, euid: %d\n", (int)getuid(), (int)geteuid()); }