]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Drop permission, if we can
authorerdgeist <>
Sun, 14 Jan 2007 20:15:04 +0000 (20:15 +0000)
committererdgeist <>
Sun, 14 Jan 2007 20:15:04 +0000 (20:15 +0000)
opentracker.c

index f4b5e21ac89a931f3e893c32583d88854101c17c..2579ab866d6f79fe086971174fc9ba884454b9b8 100644 (file)
@@ -378,10 +378,12 @@ int main( int argc, char **argv ) {
   }
 
 allparsed:
-  ot_start_time = time( NULL );
   if (socket_bind4_reuse(s,serverip,port)==-1)
     panic("socket_bind4_reuse");
 
+  setegid((gid_t)-2); setuid((uid_t)-2);
+  setgid((gid_t)-2); seteuid((uid_t)-2);
+
   if (socket_listen(s,16)==-1)
     panic("socket_listen");
 
@@ -393,6 +395,8 @@ allparsed:
   if( init_logic( serverdir ) == -1 )
     panic("Logic not started");
 
+  ot_start_time = time( NULL );
+
   io_wantread( s );
   taia_now( &next_timeout_check );
   taia_addsec( &next_timeout_check, &next_timeout_check, OT_CLIENT_TIMEOUT_CHECKINTERVAL );