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 group_match(pam_handle_t* pamh, const char* tok, const char* usr,
                       int debug)
{
    char grptok[BUFSIZ];

    if (debug)
        pam_syslog(pamh, LOG_DEBUG, "group_match: grp=%s, user=%s", tok, usr);

    if (strlen(tok) < 3)
        return NO;

    /* token is recieved under the format '(...)' */
    memset(grptok, 0, BUFSIZ);
    strncpy(grptok, tok + 1, strlen(tok) - 2);

    if (pam_modutil_user_in_group_nam_nam(pamh, usr, grptok))
        return YES;

    return NO;
}
/* group_match - match a username against token named group */
match a username against token named group
match a username against token named group
static int group_match(pam_handle_t* pamh, const char* tok, const char* usr,
                       int debug)
{
    char grptok[BUFSIZ];
    if (debug)
        pam_syslog(pamh, LOG_DEBUG, "group_match: grp=%s, user=%s", tok, usr);
    if (strlen(tok) < 3)
        return NO;
    memset(grptok, 0, BUFSIZ);
    strncpy(grptok, tok + 1, strlen(tok) - 2);
    if (pam_modutil_user_in_group_nam_nam(pamh, usr, grptok))
        return YES;
    return NO;
}
static int group_match ( pam_handle_t * pamh , const char * tok , const char * usr , int debug ) { char grptok [ BUFSIZ ] ; if ( debug ) pam_syslog ( pamh , LOG_DEBUG , " " , tok , usr ) ; if ( strlen ( tok ) < 3 ) return NO ; memset ( grptok , 0 , BUFSIZ ) ; strncpy ( grptok , tok + 1 , strlen ( tok ) - 2 ) ; if ( pam_modutil_user_in_group_nam_nam ( pamh , usr , grptok ) ) return YES ; return NO ; }
group_match - match a username against token named group
group_match - match a username against token named group
/* token is recieved under the format '(...)' */