Update of /cvsroot/tmda/tmda/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv464/bin
Modified Files:
ChangeLog tmda-ofmipd
Log Message:
Bugfix.
If we are running as root and want to bind to a privliged port, we
can't because the seteuid call comes before binding to the port.
Now we bind first and then seteuid.
Patch contributed by Tim Rice in
<[EMAIL PROTECTED]> on
tmda-workers.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/ChangeLog,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -r1.241 -r1.242
--- ChangeLog 13 Nov 2002 01:56:53 -0000 1.241
+++ ChangeLog 21 Nov 2002 21:13:27 -0000 1.242
@@ -1,3 +1,7 @@
+2002-11-21 Jason R. Mastaler <[EMAIL PROTECTED]>
+
+ * tmda-ofmipd (main): Do port binding before the seteuid call.
+
2002-11-12 Jason R. Mastaler <[EMAIL PROTECTED]>
* tmda-rfilter (verify_confirm_cookie): Append the address in
Index: tmda-ofmipd
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-ofmipd,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- tmda-ofmipd 11 Sep 2002 22:35:59 -0000 1.17
+++ tmda-ofmipd 21 Nov 2002 21:13:29 -0000 1.18
@@ -1008,6 +1008,10 @@
if authfile_mode not in (400, 600):
raise IOError, \
authfile + ' must be chmod 400 or 600!'
+ # try binding to the specified host:port
+ host, port = proxyport.split(':', 1)
+ proxy = TMDAProxy((host, int(port)),
+ ('localhost', 25))
if running_as_root:
pw_uid = Util.getuid(username)
# check ownership of authfile
@@ -1020,10 +1024,6 @@
os.setgroups(Util.getgrouplist(username))
# try seteuid()
os.seteuid(pw_uid)
- # try binding to the specified host:port
- host, port = proxyport.split(':', 1)
- proxy = TMDAProxy((host, int(port)),
- ('localhost', 25))
# Start the event loop
try:
asyncore.loop()
_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs