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/myldap.c
static const char* find_rdn_value(char** exploded_rdn, const char* attr)
{
    int i, j;
    int l;
    if (exploded_rdn == NULL)
        return NULL;
    /* go over all RDNs */
    l = strlen(attr);
    for (i = 0; exploded_rdn[i] != NULL; i++)
    {
        /* check that RDN starts with attr */
        if (strncasecmp(exploded_rdn[i], attr, l) != 0)
            continue;
        j = l;
        /* skip spaces */
        while (isspace(exploded_rdn[i][j]))
            j++;
        /* ensure that we found an equals sign now */
        if (exploded_rdn[i][j] != '=')
            continue;
        j++;
        /* skip more spaces */
        while (isspace(exploded_rdn[i][j]))
            j++;
        /* ensure that we're not at the end of the string */
        if (exploded_rdn[i][j] == '\0')
            continue;
        /* we found our value */
        return exploded_rdn[i] + j;
    }
    /* fail */
    return NULL;
}
/* Go over the entries in exploded_rdn and see if any start with
   the requested attribute. Return a reference to the value part of
   the DN (does not modify exploded_rdn). */
Go over the entries in exploded_rdn and see if any start with
the requested attribute. Return a reference to the value part of
the DN (does not modify exploded_rdn).
Go over the entries in exploded_rdn and see if any start with the requested attribute . Return a reference to the value part of the DN ( does not modify exploded_rdn ) .
static const char* find_rdn_value(char** exploded_rdn, const char* attr)
{
    int i, j;
    int l;
    if (exploded_rdn == NULL)
        return NULL;
    l = strlen(attr);
    for (i = 0; exploded_rdn[i] != NULL; i++)
    {
        if (strncasecmp(exploded_rdn[i], attr, l) != 0)
            continue;
        j = l;
        while (isspace(exploded_rdn[i][j]))
            j++;
        if (exploded_rdn[i][j] != '=')
            continue;
        j++;
        while (isspace(exploded_rdn[i][j]))
            j++;
        if (exploded_rdn[i][j] == '\0')
            continue;
        return exploded_rdn[i] + j;
    }
    return NULL;
}
static const char * find_rdn_value ( char * * exploded_rdn , const char * attr ) { int i , j ; int l ; if ( exploded_rdn == NULL ) return NULL ; l = strlen ( attr ) ; for ( i = 0 ; exploded_rdn [ i ] != NULL ; i ++ ) { if ( strncasecmp ( exploded_rdn [ i ] , attr , l ) != 0 ) continue ; j = l ; while ( isspace ( exploded_rdn [ i ] [ j ] ) ) j ++ ; if ( exploded_rdn [ i ] [ j ] != ' ' ) continue ; j ++ ; while ( isspace ( exploded_rdn [ i ] [ j ] ) ) j ++ ; if ( exploded_rdn [ i ] [ j ] == ' \0 ' ) continue ; return exploded_rdn [ i ] + j ; } return NULL ; }
Go over the entries in exploded_rdn and see if any start with
the requested attribute.
Go over the entries in exploded_rdn and see if any start with the requested attribute .
/* go over all RDNs */ /* check that RDN starts with attr */ /* skip spaces */ /* ensure that we found an equals sign now */ /* skip more spaces */ /* ensure that we're not at the end of the string */ /* we found our value */ /* fail */