Diff for /servers/slapd/user.c between versions 1.22.2.5 and 1.23

version 1.22.2.5, 2008/02/11 23:24:18 version 1.23, 2005/01/01 19:49:51
Line 1 Line 1
 /* user.c - set user id, group id and group access list */  /* user.c - set user id, group id and group access list */
 /* $OpenLDAP: pkg/ldap/servers/slapd/user.c,v 1.22.2.4 2007/01/02 21:43:59 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/user.c,v 1.22 2004/09/04 02:54:31 kurt Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 1998-2008 The OpenLDAP Foundation.   * Copyright 1998-2005 The OpenLDAP Foundation.
  * Portions Copyright 1999 PM Lashley.   * Portions Copyright 1999 PM Lashley.
  * All rights reserved.   * All rights reserved.
  *   *
Line 34 Line 34
 #include <ac/unistd.h>  #include <ac/unistd.h>
   
 #include "slap.h"  #include "slap.h"
 #include "lutil.h"  
   
 /*  /*
  * Set real and effective user id and group id, and group access list   * Set real and effective user id and group id, and group access list
Line 50  slap_init_user( char *user, char *group Line 49  slap_init_user( char *user, char *group
   
     if ( user ) {      if ( user ) {
         struct passwd *pwd;          struct passwd *pwd;
         if ( isdigit( (unsigned char) *user ) ) {          if ( isdigit( (unsigned char) *user )) {
             unsigned u;  
   
             got_uid = 1;              got_uid = 1;
             if ( lutil_atou( &u, user ) != 0 ) {              uid = atoi( user );
                 Debug( LDAP_DEBUG_ANY, "Unble to parse user %s\n",  
                        user, 0, 0 );  
   
                 exit( EXIT_FAILURE );  
             }  
             uid = (uid_t)u;  
 #ifdef HAVE_GETPWUID  #ifdef HAVE_GETPWUID
             pwd = getpwuid( uid );              pwd = getpwuid( uid );
             goto did_getpw;              goto did_getpw;
Line 95  slap_init_user( char *user, char *group Line 86  slap_init_user( char *user, char *group
     if ( group ) {      if ( group ) {
         struct group *grp;          struct group *grp;
         if ( isdigit( (unsigned char) *group )) {          if ( isdigit( (unsigned char) *group )) {
             unsigned g;              gid = atoi( group );
   
             if ( lutil_atou( &g, group ) != 0 ) {  
                 Debug( LDAP_DEBUG_ANY, "Unble to parse group %s\n",  
                        group, 0, 0 );  
   
                 exit( EXIT_FAILURE );  
             }  
             gid = (uid_t)g;  
 #ifdef HAVE_GETGRGID  #ifdef HAVE_GETGRGID
             grp = getgrgid( gid );              grp = getgrgid( gid );
             goto did_group;              goto did_group;

Removed from v.1.22.2.5  
changed lines
  Added in v.1.23


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org