openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/usermod.c
static MYLDAP_ENTRY* validate_user(MYLDAP_SESSION* session, char* username,
                                   int* rcp)
{
    int rc;
    MYLDAP_ENTRY* entry = NULL;
    /* check username for validity */
    if (!isvalidname(username))
    {
        log_log(LOG_WARNING, "request denied by validnames option");
        *rcp = LDAP_NO_SUCH_OBJECT;
        return NULL;
    }
    /* get the user entry based on the username */
    entry = uid2entry(session, username, &rc);
    if (entry == NULL)
    {
        if (rc == LDAP_SUCCESS)
            rc = LDAP_NO_SUCH_OBJECT;
        log_log(LOG_DEBUG, "\"%s\": user not found: %s", username,
                ldap_err2string(rc));
        *rcp = rc;
        return NULL;
    }
    return entry;
}
/* ensure that both userdn and username are filled in from the entry,
   returns an LDAP result code */
ensure that both userdn and username are filled in from the entry,
returns an LDAP result code
ensure that both userdn and username are filled in from the entry returns an LDAP result code
static MYLDAP_ENTRY* validate_user(MYLDAP_SESSION* session, char* username,
                                   int* rcp)
{
    int rc;
    MYLDAP_ENTRY* entry = NULL;
    if (!isvalidname(username))
    {
        log_log(LOG_WARNING, "request denied by validnames option");
        *rcp = LDAP_NO_SUCH_OBJECT;
        return NULL;
    }
    entry = uid2entry(session, username, &rc);
    if (entry == NULL)
    {
        if (rc == LDAP_SUCCESS)
            rc = LDAP_NO_SUCH_OBJECT;
        log_log(LOG_DEBUG, "\"%s\": user not found: %s", username,
                ldap_err2string(rc));
        *rcp = rc;
        return NULL;
    }
    return entry;
}
static MYLDAP_ENTRY * validate_user ( MYLDAP_SESSION * session , char * username , int * rcp ) { int rc ; MYLDAP_ENTRY * entry = NULL ; if ( ! isvalidname ( username ) ) { log_log ( LOG_WARNING , " " ) ; * rcp = LDAP_NO_SUCH_OBJECT ; return NULL ; } entry = uid2entry ( session , username , & rc ) ; if ( entry == NULL ) { if ( rc == LDAP_SUCCESS ) rc = LDAP_NO_SUCH_OBJECT ; log_log ( LOG_DEBUG , " \" \" " , username , ldap_err2string ( rc ) ) ; * rcp = rc ; return NULL ; } return entry ; }
ensure that both userdn and username are filled in from the entry,
returns an LDAP result code
ensure that both userdn and username are filled in from the entry returns an LDAP result code
/* check username for validity */ /* get the user entry based on the username */