Commit Diff


commit - bf84670aaad3371060868b5664ab26706425b16c
commit + 70c9c051534f1547fb94ad3a63c5111fb8a4a82a
blob - b19f702868de5558284adb9fe7c90f564f3a9693
blob + 597e0dffa34627c57e8ff185724757954691f4d0
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: ngircd.c,v 1.57 2002/10/09 16:53:02 alex Exp $
+ * $Id: ngircd.c,v 1.58 2002/11/10 13:38:41 alex Exp $
  *
  * ngircd.c: Hier beginnt alles ;-)
  */
@@ -29,6 +29,8 @@
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <time.h>
+#include <pwd.h>
+#include <grp.h>
 
 #include "resolve.h"
 #include "conn.h"
@@ -58,6 +60,8 @@ LOCAL VOID Show_Help PARAMS(( VOID ));
 GLOBAL int
 main( int argc, const char *argv[] )
 {
+	struct passwd *pwd;
+	struct group *grp;
 	BOOLEAN ok, configtest = FALSE;
 	LONG pid, n;
 	INT i;
@@ -276,8 +280,12 @@ main( int argc, const char *argv[] )
 				if( setuid( Conf_UID ) != 0 ) Log( LOG_ERR, "Can't change User-ID to %u: %s", Conf_UID, strerror( errno ));
 			}
 		}
-		Log( LOG_INFO, "Running as user %ld, group %ld, with PID %ld.", (LONG)getuid( ), (LONG)getgid( ), (LONG)getpid( ));
+		
+		/* User, Gruppe und Prozess-ID des Daemon ausgeben */
+		pwd = getpwuid( getuid( )); grp = getgrgid( getgid( ));
+		Log( LOG_INFO, "Running as user %s(%ld), group %s(%ld), with PID %ld.", pwd ? pwd->pw_name : "unknown", (LONG)getuid( ), grp ? grp->gr_name : "unknown", (LONG)getgid( ), (LONG)getpid( ));
 
+		/* stderr in "Error-File" umlenken */
 		Log_InitErrorfile( );
 
 		/* Signal-Handler initialisieren */