Changeset 1368

Show
Ignore:
Timestamp:
10/04/2006 07:36:10 AM (23 months ago)
Author:
jan
Message:

merged [270] (fixes #871)

- call initgroups() in spawn-fcgi.c

Location:
branches/lighttpd-1.4.x/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/src/server.c

    r1318 r1368  
    736736                        setgroups(0, NULL); 
    737737                } 
    738                 if (srv->srvconf.username->used && srv->srvconf.groupname->used) 
    739                         initgroups(srv->srvconf.username->ptr, grp->gr_gid); 
    740                 if (srv->srvconf.username->used) setuid(pwd->pw_uid); 
     738                 
     739                if (srv->srvconf.username->used) { 
     740                        if (srv->srvconf.groupname->used) { 
     741                                initgroups(srv->srvconf.username->ptr, grp->gr_gid); 
     742                        } 
     743                        setuid(pwd->pw_uid); 
     744                } 
    741745#endif 
    742746#ifdef HAVE_PRCTL 
  • branches/lighttpd-1.4.x/src/spawn-fcgi.c

    r1029 r1368  
    425425                if (groupname) { 
    426426                        setgid(grp->gr_gid); 
    427                         setgroups(0, NULL); 
    428                 } 
    429                 if (username) setuid(pwd->pw_uid); 
     427                } 
     428                if (username) { 
     429                        if (groupname) { 
     430                                initgroups(username, grp->gr_gid); 
     431                        } 
     432                        setuid(pwd->pw_uid); 
     433                } 
    430434        } 
    431435