version 1.128, 2009/01/27 09:05:55
|
version 1.129, 2009/07/07 20:30:55
|
Line 1
|
Line 1
|
/* root_dse.c - Provides the Root DSA-Specific Entry */ |
/* root_dse.c - Provides the Root DSA-Specific Entry */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/root_dse.c,v 1.127 2009/01/21 23:40:27 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/root_dse.c,v 1.128 2009/01/27 09:05:55 hyc Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 1999-2009 The OpenLDAP Foundation. |
* Copyright 1999-2009 The OpenLDAP Foundation. |
Line 401 int
|
Line 401 int
|
root_dse_read_file( const char *fname ) |
root_dse_read_file( const char *fname ) |
{ |
{ |
struct LDIFFP *fp; |
struct LDIFFP *fp; |
int rc = 0, lineno = 0, lmax = 0; |
int rc = 0, lineno = 0, lmax = 0, ldifrc; |
char *buf = NULL; |
char *buf = NULL; |
|
|
if ( (fp = ldif_open( fname, "r" )) == NULL ) { |
if ( (fp = ldif_open( fname, "r" )) == NULL ) { |
Line 421 root_dse_read_file( const char *fname )
|
Line 421 root_dse_read_file( const char *fname )
|
} |
} |
usr_attr->e_attrs = NULL; |
usr_attr->e_attrs = NULL; |
|
|
while( ldif_read_record( fp, &lineno, &buf, &lmax ) ) { |
while(( ldifrc = ldif_read_record( fp, &lineno, &buf, &lmax )) > 0 ) { |
Entry *e = str2entry( buf ); |
Entry *e = str2entry( buf ); |
Attribute *a; |
Attribute *a; |
|
|
Line 429 root_dse_read_file( const char *fname )
|
Line 429 root_dse_read_file( const char *fname )
|
Debug( LDAP_DEBUG_ANY, "root_dse_read_file: " |
Debug( LDAP_DEBUG_ANY, "root_dse_read_file: " |
"could not parse entry (file=\"%s\" line=%d)\n", |
"could not parse entry (file=\"%s\" line=%d)\n", |
fname, lineno, 0 ); |
fname, lineno, 0 ); |
rc = EXIT_FAILURE; |
rc = LDAP_OTHER; |
break; |
break; |
} |
} |
|
|
Line 440 root_dse_read_file( const char *fname )
|
Line 440 root_dse_read_file( const char *fname )
|
"- dn=\"%s\" (file=\"%s\" line=%d)\n", |
"- dn=\"%s\" (file=\"%s\" line=%d)\n", |
e->e_dn, fname, lineno ); |
e->e_dn, fname, lineno ); |
entry_free( e ); |
entry_free( e ); |
rc = EXIT_FAILURE; |
rc = LDAP_OTHER; |
break; |
break; |
} |
} |
|
|
Line 463 root_dse_read_file( const char *fname )
|
Line 463 root_dse_read_file( const char *fname )
|
if (rc) break; |
if (rc) break; |
} |
} |
|
|
|
if ( ldifrc < 0 ) |
|
rc = LDAP_OTHER; |
|
|
if (rc) { |
if (rc) { |
entry_free( usr_attr ); |
entry_free( usr_attr ); |
usr_attr = NULL; |
usr_attr = NULL; |