This is a discussion on Small diff for portmap (not calling endpwent) within the lucky.openbsd.tech forums, part of the OpenBSD category; --> I was taking a look at some examples of privilege dropping and I found that portmap is not calling ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I was taking a look at some examples of privilege dropping and I found that portmap is not calling endpwent() after the call to getpwnam(). A small diff to add it is bellow. *this is the first time I send a diff to openbsd, so please, be nice if I did something wrong... Thanks, Daniel $ cvs diff -u portmap.c Index: portmap.c ================================================== ================= RCS file: /cvs/src/usr.sbin/portmap/portmap.c,v retrieving revision 1.33 diff -u -r1.33 portmap.c --- portmap.c 3 May 2005 01:01:15 -0000 1.33 +++ portmap.c 23 May 2005 04:01:32 -0000 @@ -246,6 +246,9 @@ syslog(LOG_ERR, "cannot chdir to /var/empty."); exit(1); } + + endpwent(); + chdir("/"); if (pw) { if (setgroups(1, &pw->pw_gid) == -1 || __________________________________________________ __Yahoo! Mail, cada vez melhor: agora com 1GB de espago gratis! http://mail.yahoo.com.br |
| Thread Tools | |
| Display Modes | |
|
|