X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Froot_dse.c;h=019a530af2b7519b35efef7e4e457ae6f8f3fe31;hb=accd19edbccfc6442a770dfcbbb45f23e3482fd3;hp=8b7322122e6f0cb82155bf9970b410e9aa704c4c;hpb=fb6dfb852d558b2fd775050079569758b61a066c;p=openldap diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 8b7322122e..019a530af2 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1999-2009 The OpenLDAP Foundation. + * Copyright 1999-2012 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -401,7 +401,7 @@ int root_dse_read_file( const char *fname ) { struct LDIFFP *fp; - int rc = 0, lineno = 0, lmax = 0; + int rc = 0, lineno = 0, lmax = 0, ldifrc; char *buf = NULL; if ( (fp = ldif_open( fname, "r" )) == NULL ) { @@ -421,7 +421,7 @@ root_dse_read_file( const char *fname ) } 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 ); Attribute *a; @@ -429,7 +429,7 @@ root_dse_read_file( const char *fname ) Debug( LDAP_DEBUG_ANY, "root_dse_read_file: " "could not parse entry (file=\"%s\" line=%d)\n", fname, lineno, 0 ); - rc = EXIT_FAILURE; + rc = LDAP_OTHER; break; } @@ -440,7 +440,7 @@ root_dse_read_file( const char *fname ) "- dn=\"%s\" (file=\"%s\" line=%d)\n", e->e_dn, fname, lineno ); entry_free( e ); - rc = EXIT_FAILURE; + rc = LDAP_OTHER; break; } @@ -463,6 +463,9 @@ root_dse_read_file( const char *fname ) if (rc) break; } + if ( ldifrc < 0 ) + rc = LDAP_OTHER; + if (rc) { entry_free( usr_attr ); usr_attr = NULL;