On Sat, 16 Nov 2002, Jason R. Mastaler wrote:
> Tim Rice <[EMAIL PROTECTED]> writes:
>
> > 1. If we run tmda-ofmipd as root with the -R option, why do
> > we even need a /etc/tfmipd file?
> >
> > 2. 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.
> > Any reason to not bind first and then seteuid?
>
> I think these are just bugs that will have to be fixed.
Here is a patch for problem 2.
-----------------< cut >---------------------
--- tmda-ofmipd.old Wed Nov 20 19:59:59 2002
+++ tmda-ofmipd Wed Nov 20 20:06:28 2002
@@ -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()
-----------------< end cut >---------------------
> _________________________________________________
> tmda-workers mailing list ([EMAIL PROTECTED])
> http://tmda.net/lists/listinfo/tmda-workers
>
--
Tim Rice Multitalents (707) 887-1469
[EMAIL PROTECTED]
_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers