openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libpam/1.3.1-r0/Linux-PAM-1.3.1/modules/pam_access/pam_access.c
static int string_match(pam_handle_t* pamh, const char* tok, const char* string,
                        int debug)
{

    if (debug)
        pam_syslog(pamh, LOG_DEBUG, "string_match: tok=%s, item=%s", tok,
                   string);

    /*
     * If the token has the magic value "ALL" the match always succeeds.
     * Otherwise, return YES if the token fully matches the string.
     * "NONE" token matches NULL string.
     */

    if (strcasecmp(tok, "ALL") == 0)
    { /* all: always matches */
        return (ALL);
    }
    else if (string != NULL)
    {
        if (strcasecmp(tok, string) == 0)
        { /* try exact match */
            return (YES);
        }
    }
    else if (strcasecmp(tok, "NONE") == 0)
    {
        return (YES);
    }
    return (NO);
}
/* string_match - match a string against one token */
match a string against one token
match a string against one token
static int string_match(pam_handle_t* pamh, const char* tok, const char* string,
                        int debug)
{
    if (debug)
        pam_syslog(pamh, LOG_DEBUG, "string_match: tok=%s, item=%s", tok,
                   string);
    if (strcasecmp(tok, "ALL") == 0)
    { 
        return (ALL);
    }
    else if (string != NULL)
    {
        if (strcasecmp(tok, string) == 0)
        { 
            return (YES);
        }
    }
    else if (strcasecmp(tok, "NONE") == 0)
    {
        return (YES);
    }
    return (NO);
}
static int string_match ( pam_handle_t * pamh , const char * tok , const char * string , int debug ) { if ( debug ) pam_syslog ( pamh , LOG_DEBUG , " " , tok , string ) ; if ( strcasecmp ( tok , " " ) == 0 ) { return ( ALL ) ; } else if ( string != NULL ) { if ( strcasecmp ( tok , string ) == 0 ) { return ( YES ) ; } } else if ( strcasecmp ( tok , " " ) == 0 ) { return ( YES ) ; } return ( NO ) ; }
string_match - match a string against one token
string_match - match a string against one token
/*
     * If the token has the magic value "ALL" the match always succeeds.
     * Otherwise, return YES if the token fully matches the string.
     * "NONE" token matches NULL string.
     */ /* all: always matches */ /* try exact match */