diff options
| author | Alexander Barton <alex@barton.de> | 2002-03-29 23:34:18 +0000 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2002-03-29 23:34:18 +0000 |
| commit | fe06f6e990a88cc6d0cce4586fa5ad713589eeb1 (patch) | |
| tree | 0766b126604b1f32367baea8f699eb300f2d3ec9 /src | |
| parent | 3d74a9c323fa99dbcba47a1c3978ef4984530f92 (diff) | |
| download | ngircd-fe06f6e990a88cc6d0cce4586fa5ad713589eeb1.tar.gz ngircd-fe06f6e990a88cc6d0cce4586fa5ad713589eeb1.zip | |
- Error-Log wird nach User-Wechsel mit Log_InitErrorfile() initialisiert.
- Einige Tippfehler korrigiert ...
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/ngircd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index 623b96c1..7becdda8 100644 --- a/src/ngircd/ngircd.c +++ b/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.39 2002/03/29 22:56:40 alex Exp $ + * $Id: ngircd.c,v 1.40 2002/03/29 23:34:18 alex Exp $ * * ngircd.c: Hier beginnt alles ;-) */ @@ -249,21 +249,23 @@ GLOBAL int main( int argc, const char *argv[] ) /* Wenn als root ausgefuehrt und eine andere UID * konfiguriert ist, jetzt zu dieser wechseln */ - if( getuid( ) != 0 ) + if( getuid( ) == 0 ) { - if( Conf_GID > 0 ) + if( Conf_GID != 0 ) { /* Neue Group-ID setzen */ if( setgid( Conf_GID ) != 0 ) Log( LOG_ERR, "Can't change Group-ID to %u: %s", Conf_GID, strerror( errno )); } - if( Conf_UID > 0 ) + if( Conf_UID != 0 ) { /* Neue User-ID setzen */ - if( setgid( Conf_UID ) != 0 ) Log( LOG_ERR, "Can't change User-ID to %u: %s", Conf_UID, strerror( errno )); + 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.", (INT32)getuid( ), (INT32)getgid( )); + Log_InitErrorfile( ); + /* Signal-Handler initialisieren */ Initialize_Signal_Handler( ); |