[Date Prev][Date Next] [Chronological] [Thread] [Top]

back-ldif and failed binds



The purpose of the code below (from back-ldif/ldif.c inside the ldif_back_bind() function) is a bit obscure, and I suspect it is incorrect. In fact, it's trying to determine, in case no entry is found, if invalidCredentials or noSuchObject should be returned. I suspect in any case invalidCredentials is the right error; however, the test is malformed because it applies to be_root_dn, which is a pointer to a static storage and, as such, cannot be NULL. I guess the intended test is BER_BVISNULL( be_root_dn( op->o_bd ) )

   /* no object is found for them */
   if(entry == NULL) {
       if(be_isroot_pw(op)) {
           return_val = LDAP_SUCCESS;
           goto return_result;
       }
       else if(be_root_dn(op->o_bd)) {
           return_val = LDAP_INVALID_CREDENTIALS;
           rs->sr_err = LDAP_INVALID_CREDENTIALS;
           goto return_result;
       }
       else {
           rs->sr_err = LDAP_NO_SUCH_OBJECT;
           return_val = 1;
           goto return_result;
       }
   }

p.


SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497