Changeset 902 in openpam


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@…>

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CREDITS

    r854 r902  
    4444        Mikko Työläjärvi <mbsd@pacbell.net>
    4545        Nick Hibma <nick@van-laarhoven.org>
     46        Patrick Bihan-Faou <patrick-fbsd@mindstep.com>
    4647        Robert Watson <rwatson@freebsd.org>
    4748        Ruslan Ermilov <ru@freebsd.org>
  • trunk/LICENSE

    r889 r902  
    11
    22Copyright (c) 2002-2003 Networks Associates Technology, Inc.
    3 Copyright (c) 2004-2016 Dag-Erling Smørgrav
     3Copyright (c) 2004-2017 Dag-Erling Smørgrav
    44Copyright (c) 2012-2016 The University of Oslo
    55All rights reserved.
  • 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)
  • 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.