[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tmda-cvs
Subject:    CVS: tmda/bin tmda-ofmipd,1.2,1.3
From:       "Jason R. Mastaler" <jasonrm () users ! sourceforge ! net>
Date:       2002-06-14 22:48:43
[Download RAW message or body]

Update of /cvsroot/tmda/tmda/bin
In directory usw-pr-cvs1:/tmp/cvs-serv21151/bin

Modified Files:
	tmda-ofmipd 
Log Message:
Let's not forget to setgid() to the group of the user running the daemon.


Index: tmda-ofmipd
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-ofmipd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- tmda-ofmipd	14 Jun 2002 02:04:00 -0000	1.2
+++ tmda-ofmipd	14 Jun 2002 22:48:40 -0000	1.3
@@ -666,6 +666,7 @@
 
 def main():
     pw_uid = pwd.getpwnam(username)[2]
+    pw_gid = pwd.getpwnam(username)[3]
     # check ownership of authfile
     if Util.getfileuid(authfile) != pw_uid:
         raise IOError, \
@@ -675,6 +676,8 @@
     if authfile_mode not in (400, 600):
         raise IOError, \
               authfile + ' must be chmod 400 or 600!'
+    # try setgid()
+    os.setgid(pw_gid)
     # try setuid()
     os.setuid(pw_uid)
     # try binding to the specified host:port

____________________________________________
tmda-cvs mailing list
http://libertine.org/lists/listinfo/tmda-cvs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic