Diff for /servers/slapd/user.c between versions 1.22 and 1.22.2.3

version 1.22, 2004/09/04 02:54:31 version 1.22.2.3, 2006/01/03 22:16:16
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.21 2004/01/01 18:15:32 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/user.c,v 1.22.2.2 2005/11/26 23:54:49 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-2004 The OpenLDAP Foundation.   * Copyright 1998-2006 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 49  slap_init_user( char *user, char *group Line 50  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;
             uid = atoi( user );              if ( lutil_atou( &u, user ) != 0 ) {
                   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 86  slap_init_user( char *user, char *group Line 95  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 )) {
             gid = atoi( group );              unsigned g;
   
               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  
changed lines
  Added in v.1.22.2.3


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