X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fuser.c;h=2613fbcfa42c8095cf77714973a2a3acd4d888d6;hb=00ac49a1fd4edff795faf81ed890774ca0bdbf58;hp=d79325bfdd75882ef03fe3ce84399f2a6e3d4e00;hpb=30b3958f94704bfafe89e36f57f21721d6440a2d;p=openldap diff --git a/servers/slapd/user.c b/servers/slapd/user.c index d79325bfdd..2613fbcfa4 100644 --- a/servers/slapd/user.c +++ b/servers/slapd/user.c @@ -1,6 +1,10 @@ +/* + * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ /* user.c - set user id, group id and group access list * - * Copyright 1999 by PM Lashley and The OpenLDAP Foundation. + * Copyright 1999 by PM Lashley. * All rights reserved. * * Redistribution and use in source and binary forms are permitted only @@ -60,7 +64,7 @@ slap_init_user( char *user, char *group ) if ( pwd == NULL ) { Debug( LDAP_DEBUG_ANY, "No passwd entry for user %s\n", user, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } if ( got_uid ) { free( user ); @@ -93,7 +97,7 @@ slap_init_user( char *user, char *group ) if ( grp == NULL ) { Debug( LDAP_DEBUG_ANY, "No group entry for group %s\n", group, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } } free( group ); @@ -104,7 +108,7 @@ slap_init_user( char *user, char *group ) if ( getuid() == 0 && initgroups( user, gid ) != 0 ) { Debug( LDAP_DEBUG_ANY, "Could not set the group access (gid) list\n", 0, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } free( user ); } @@ -117,13 +121,13 @@ slap_init_user( char *user, char *group ) if ( setgid( gid ) != 0 ) { Debug( LDAP_DEBUG_ANY, "Could not set real group id to %d\n", gid, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } #ifdef HAVE_SETEGID if ( setegid( gid ) != 0 ) { Debug( LDAP_DEBUG_ANY, "Could not set effective group id to %d\n", gid, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } #endif } @@ -132,13 +136,13 @@ slap_init_user( char *user, char *group ) if ( setuid( uid ) != 0 ) { Debug( LDAP_DEBUG_ANY, "Could not set real user id to %d\n", uid, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } #ifdef HAVE_SETEUID if ( seteuid( uid ) != 0 ) { Debug( LDAP_DEBUG_ANY, "Could not set effective user id to %d\n", uid, 0, 0 ); - exit( 1 ); + exit( EXIT_FAILURE ); } #endif }