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_unix/support.c
int _unix_blankpasswd(pam_handle_t* pamh, unsigned int ctrl, const char* name)
{
    struct passwd* pwd = NULL;
    char* salt = NULL;
    int retval;

    D(("called"));

    /*
     * This function does not have to be too smart if something goes
     * wrong, return FALSE and let this case to be treated somewhere
     * else (CG)
     */

    if (on(UNIX__NONULL, ctrl))
        return 0; /* will fail but don't let on yet */

    if (on(UNIX_NULLOK_SECURE, ctrl))
    {
        int retval2;
        const void* uttyname;
        retval2 = pam_get_item(pamh, PAM_TTY, &uttyname);
        if (retval2 != PAM_SUCCESS || uttyname == NULL)
            return 0;

        if (_pammodutil_tty_secure(pamh, (const char*)uttyname) != PAM_SUCCESS)
            return 0;
    }

    /* UNIX passwords area */

    retval = get_pwd_hash(pamh, name, &pwd, &salt);

    if (retval == PAM_UNIX_RUN_HELPER)
    {
        /* salt will not be set here so we can return immediately */
        if (_unix_run_helper_binary(pamh, NULL, ctrl, name) == PAM_SUCCESS)
            return 1;
        else
            return 0;
    }

    /* Does this user have a password? */
    if (salt == NULL)
    {
        retval = 0;
    }
    else
    {
        if (strlen(salt) == 0)
            retval = 1;
        else
            retval = 0;
    }

    /* tidy up */

    if (salt)
        _pam_delete(salt);

    return retval;
}
/*
 * _unix_blankpasswd() is a quick check for a blank password
 *
 * returns TRUE if user does not have a password
 * - to avoid prompting for one in such cases (CG)
 */
_unix_blankpasswd() is a quick check for a blank password
returns TRUE if user does not have a password
- to avoid prompting for one in such cases (CG)
_unix_blankpasswd () is a quick check for a blank password returns TRUE if user does not have a password - to avoid prompting for one in such cases ( CG )
int _unix_blankpasswd(pam_handle_t* pamh, unsigned int ctrl, const char* name)
{
    struct passwd* pwd = NULL;
    char* salt = NULL;
    int retval;
    D(("called"));
    if (on(UNIX__NONULL, ctrl))
        return 0; 
    if (on(UNIX_NULLOK_SECURE, ctrl))
    {
        int retval2;
        const void* uttyname;
        retval2 = pam_get_item(pamh, PAM_TTY, &uttyname);
        if (retval2 != PAM_SUCCESS || uttyname == NULL)
            return 0;
        if (_pammodutil_tty_secure(pamh, (const char*)uttyname) != PAM_SUCCESS)
            return 0;
    }
    retval = get_pwd_hash(pamh, name, &pwd, &salt);
    if (retval == PAM_UNIX_RUN_HELPER)
    {
        if (_unix_run_helper_binary(pamh, NULL, ctrl, name) == PAM_SUCCESS)
            return 1;
        else
            return 0;
    }
    if (salt == NULL)
    {
        retval = 0;
    }
    else
    {
        if (strlen(salt) == 0)
            retval = 1;
        else
            retval = 0;
    }
    if (salt)
        _pam_delete(salt);
    return retval;
}
int _unix_blankpasswd ( pam_handle_t * pamh , unsigned int ctrl , const char * name ) { struct passwd * pwd = NULL ; char * salt = NULL ; int retval ; D ( ( " " ) ) ; if ( on ( UNIX__NONULL , ctrl ) ) return 0 ; if ( on ( UNIX_NULLOK_SECURE , ctrl ) ) { int retval2 ; const void * uttyname ; retval2 = pam_get_item ( pamh , PAM_TTY , & uttyname ) ; if ( retval2 != PAM_SUCCESS || uttyname == NULL ) return 0 ; if ( _pammodutil_tty_secure ( pamh , ( const char * ) uttyname ) != PAM_SUCCESS ) return 0 ; } retval = get_pwd_hash ( pamh , name , & pwd , & salt ) ; if ( retval == PAM_UNIX_RUN_HELPER ) { if ( _unix_run_helper_binary ( pamh , NULL , ctrl , name ) == PAM_SUCCESS ) return 1 ; else return 0 ; } if ( salt == NULL ) { retval = 0 ; } else { if ( strlen ( salt ) == 0 ) retval = 1 ; else retval = 0 ; } if ( salt ) _pam_delete ( salt ) ; return retval ; }
_unix_blankpasswd() is a quick check for a blank password
 returns TRUE if user does not have a password
 - to avoid prompting for one in such cases (CG)
_unix_blankpasswd () is a quick check for a blank password returns TRUE if user does not have a password - to avoid prompting for one in such cases ( CG )
/*
     * This function does not have to be too smart if something goes
     * wrong, return FALSE and let this case to be treated somewhere
     * else (CG)
     */ /* will fail but don't let on yet */ /* UNIX passwords area */ /* salt will not be set here so we can return immediately */ /* Does this user have a password? */ /* tidy up */