commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r164072 - /jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
Date Thu, 21 Apr 2005 15:13:51 GMT
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


Mime
View raw message