Unix Technical Forum

Small diff for portmap (not calling endpwent)

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 11:33 AM
Daniel Cid
 
Posts: n/a
Default Small diff for portmap (not calling endpwent)

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:26 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com