Changeset 00c910


Ignore:
Timestamp:
07/12/08 14:05:59 (5 years ago)
Author:
Andrew Griffiths <andrewg@…>
Branches:
master
Children:
f70d16
Parents:
090c5f
git-author:
Andrew Griffiths <andrewg@…> (07/12/08 14:05:59)
git-committer:
Erik Ekman <erik@…> (02/04/12 20:33:56)
Message:

applied security patch from Andrew Griffiths, limit user groups

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/iodine.c

    r791c3d r00c910  
    731731         
    732732        if (username != NULL) { 
    733                 if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) { 
     733                gid_t gids[1]; 
     734                gids[0] = pw->pw_gid; 
     735                if (setgroups(1, gids) < 0 || setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) { 
    734736                        warnx("Could not switch to user %s!\n", username); 
    735737                        usage(); 
  • src/iodined.c

    ra36ce9 r00c910  
    584584        signal(SIGINT, sigint); 
    585585        if (username != NULL) { 
    586                 if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) { 
     586                gid_t gids[1]; 
     587                gids[0] = pw->pw_gid; 
     588                if (setgroups(1, gids) < 0 || setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) { 
    587589                        warnx("Could not switch to user %s!\n", username); 
    588590                        usage(); 
Note: See TracChangeset for help on using the changeset viewer.