Changeset 902 in openpam for trunk/lib/libpam/pam_get_user.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_user.c

    r670 r902  
    11/*-
    22 * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
    3  * Copyright (c) 2004-2011 Dag-Erling Smørgrav
     3 * Copyright (c) 2004-2017 Dag-Erling Smørgrav
    44 * All rights reserved.
    55 *
     
    7979                prompt = promptp;
    8080        /* no prompt provided, see if there is one tucked away somewhere */
    81         if (prompt == NULL)
    82                 if (pam_get_item(pamh, PAM_USER_PROMPT, &promptp) &&
    83                     promptp != NULL)
     81        if (prompt == NULL) {
     82                r = pam_get_item(pamh, PAM_USER_PROMPT, &promptp);
     83                if (r == PAM_SUCCESS && promptp != NULL)
    8484                        prompt = promptp;
     85        }
    8586        /* fall back to hardcoded default */
    8687        if (prompt == NULL)
Note: See TracChangeset for help on using the changeset viewer.