From 4dc9218c6b3cd5611ee0bc387029711dc0f614fd Mon Sep 17 00:00:00 2001 From: Pavel Vinogradov Date: Mon, 4 Jul 2016 21:22:56 -0400 Subject: [PATCH] Quite trivial fix of issue #21 --- src/parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parse.c b/src/parse.c index 84d97b9..1f9fe4e 100644 --- a/src/parse.c +++ b/src/parse.c @@ -271,6 +271,8 @@ static ReturnCode ExecuteConfigObject(ObjTable *InObj, const char *CurCmd) if (CurCmd == InObj->ObjectStartCommand) { /*Set user and group if desired.*/ + if (InObj->GroupID != 0) setgid(InObj->GroupID); + if (InObj->UserID != 0) { struct passwd *UserStruct = getpwuid(InObj->UserID); @@ -290,10 +292,9 @@ static ReturnCode ExecuteConfigObject(ObjTable *InObj, const char *CurCmd) if (!InObj->ObjectWorkingDirectory) chdir(UserStruct->pw_dir); - + } - if (InObj->GroupID != 0) setgid(InObj->GroupID); } #ifndef NOSHELL -- 2.10.1 .