Ubuntu Pastebin

Paste from TJ at Wed, 4 Nov 2015 22:58:49 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// from modules/pam_unix/passverify.c 

int
helper_verify_password(const char *name, const char *p, int nullok)
{
        struct passwd *pwd = NULL;
        char *salt = NULL;
        int retval;

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

        if (pwd == NULL || salt == NULL) {
                helper_log_err(LOG_WARNING, "check pass; user unknown");
                retval = PAM_USER_UNKNOWN;
        } else {
                retval = verify_pwd_hash(p, salt, nullok);
        }

        if (salt) {
                _pam_overwrite(salt);
                _pam_drop(salt);
        }

        p = NULL;               /* no longer needed here */

        return retval;
}
Download as text