You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jf...@apache.org on 2005/04/21 17:13:51 UTC

svn commit: r164072 - /jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c

Author: jfclere
Date: Thu Apr 21 08:13:50 2005
New Revision: 164072

URL: http://svn.apache.org/viewcvs?rev=164072&view=rev
Log:
Add supplementary groups (Fix PR 34493).

Modified:
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c?rev=164072&r1=164071&r2=164072&view=diff
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c (original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c Thu Apr 21 08:13:50 2005
@@ -24,6 +24,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <pwd.h>
+#include <grp.h>
 #ifdef OS_LINUX
 #include <sys/prctl.h>
 #include <sys/syscall.h>
@@ -86,6 +87,10 @@
     if (user!=NULL) {
         if (setgid(gid)!=0) {
             log_error("Cannot set group id for user '%s'",user);
+            return(-1);
+        }
+        if (initgroups(user, gid)!=0) {
+            log_error("Cannot set supplement group list for user '%s'",user);
             return(-1);
         }
         if (setuid(uid)!=0) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org