vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| * Daniel Cid <danielcid@yahoo.com.br> [2005-05-23 07:13]: > 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 || no, you cannot call endpwent and still use the getpwent return value - see my commit from a few hours ago for the right fix |
| Thread Tools | |
| Display Modes | |
|
|