sys: move getpwnam() call to main.c

Pass uid/gid instead of user name to the root dropping function.
This commit is contained in:
Miroslav Lichvar
2015-08-10 15:53:36 +02:00
parent 236576c124
commit 6402350c83
6 changed files with 20 additions and 22 deletions

6
sys.c
View File

@@ -27,6 +27,8 @@
#include "config.h"
#include "sysincl.h"
#include "sys.h"
#include "logging.h"
@@ -107,10 +109,10 @@ SYS_Finalise(void)
/* ================================================== */
void SYS_DropRoot(char *user)
void SYS_DropRoot(uid_t uid, gid_t gid)
{
#if defined(LINUX) && defined (FEAT_PRIVDROP)
SYS_Linux_DropRoot(user);
SYS_Linux_DropRoot(uid, gid);
#else
LOG_FATAL(LOGF_Sys, "dropping root privileges not supported");
#endif