Changeset 902 in openpam for trunk/lib/libpam/pam_get_authtok.c


Ignore:
Timestamp:
Jan 17, 2017, 2:57:09 PM (4 years ago)
Author:
Dag-Erling Smørgrav
Message:

Correctly compare the return value from pam_get_item() to PAM_SUCCESS
instead of assuming (incorrectly) that it returns non-zero on success.
Bump dates as needed.

Reported by: Patrick Bihan-Faou <patrick-fbsd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/libpam/pam_get_authtok.c

    r890 r902  
    11/*-
    22 * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
    3  * Copyright (c) 2004-2014 Dag-Erling Smørgrav
     3 * Copyright (c) 2004-2017 Dag-Erling Smørgrav
    44 * All rights reserved.
    55 *
     
    123123                prompt = promptp;
    124124        /* no prompt provided, see if there is one tucked away somewhere */
    125         if (prompt == NULL)
    126                 if (pam_get_item(pamh, pitem, &promptp) && promptp != NULL)
     125        if (prompt == NULL) {
     126                r = pam_get_item(pamh, pitem, &promptp);
     127                if (r == PAM_SUCCESS && promptp != NULL)
    127128                        prompt = promptp;
     129        }
    128130        /* fall back to hardcoded default */
    129131        if (prompt == NULL)
Note: See TracChangeset for help on using the changeset viewer.