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_ftp/pam_ftp.c
static int lookup(const char* name, const char* list, char** _user)
{
    int anon = 0;

    if (list && *list)
    {
        const char* l;
        char *list_copy, *x;
        char* sptr = NULL;

        list_copy = strdup(list);
        x = list_copy;
        while (list_copy && (l = strtok_r(x, ",", &sptr)))
        {
            x = NULL;
            if (!strcmp(name, l))
            {
                *_user = list_copy;
                anon = 1;
                break;
            }
        }
        if (*_user != list_copy)
        {
            free(list_copy);
        }
    }
    else
    {
#define MAX_L 2
        static const char* l[MAX_L] = {"ftp", "anonymous"};
        int i;

        for (i = 0; i < MAX_L; ++i)
        {
            if (!strcmp(l[i], name))
            {
                *_user = strdup(l[0]);
                anon = 1;
                break;
            }
        }
    }

    return anon;
}
/*
 * check if name is in list or default list. place users name in *_user
 * return 1 if listed 0 if not.
 */
check if name is in list or default list. place users name in *_user
return 1 if listed 0 if not.
check if name is in list or default list . place users name in * _user return 1 if listed 0 if not .
static int lookup(const char* name, const char* list, char** _user)
{
    int anon = 0;
    if (list && *list)
    {
        const char* l;
        char *list_copy, *x;
        char* sptr = NULL;
        list_copy = strdup(list);
        x = list_copy;
        while (list_copy && (l = strtok_r(x, ",", &sptr)))
        {
            x = NULL;
            if (!strcmp(name, l))
            {
                *_user = list_copy;
                anon = 1;
                break;
            }
        }
        if (*_user != list_copy)
        {
            free(list_copy);
        }
    }
    else
    {
#define MAX_L 2
        static const char* l[MAX_L] = {"ftp", "anonymous"};
        int i;
        for (i = 0; i < MAX_L; ++i)
        {
            if (!strcmp(l[i], name))
            {
                *_user = strdup(l[0]);
                anon = 1;
                break;
            }
        }
    }
    return anon;
}
static int lookup ( const char * name , const char * list , char * * _user ) { int anon = 0 ; if ( list && * list ) { const char * l ; char * list_copy , * x ; char * sptr = NULL ; list_copy = strdup ( list ) ; x = list_copy ; while ( list_copy && ( l = strtok_r ( x , " " , & sptr ) ) ) { x = NULL ; if ( ! strcmp ( name , l ) ) { * _user = list_copy ; anon = 1 ; break ; } } if ( * _user != list_copy ) { free ( list_copy ) ; } } else { #define MAX_L  2 static const char * l [ MAX_L ] = { " " , " " } ; int i ; for ( i = 0 ; i < MAX_L ; ++ i ) { if ( ! strcmp ( l [ i ] , name ) ) { * _user = strdup ( l [ 0 ] ) ; anon = 1 ; break ; } } } return anon ; }
check if name is in list or default list.
check if name is in list or default list .