Changeset 35 in openpam for trunk/lib/pam_get_user.c


Ignore:
Timestamp:
Feb 6, 2002, 1:25:36 PM (19 years ago)
Author:
Dag-Erling Smørgrav
Message:

According to bde, it's OK to omit parentheses when taking the size
of an object rather than a type.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_get_user.c

    r24 r35  
    5050int
    5151pam_get_user(pam_handle_t *pamh,
    52         char **user,
     52        const char **user,
    5353        const char *prompt)
    5454{
    55         char *p;
     55        char *p, *resp;
    5656        int r;
    5757
     
    5959                return (PAM_SYSTEM_ERR);
    6060
    61         r = pam_get_item(pamh, PAM_USER, (void **)user);
     61        r = pam_get_item(pamh, PAM_USER, (const void **)user);
    6262        if (r == PAM_SUCCESS)
    6363                return (PAM_SUCCESS);
    6464        if (prompt == NULL) {
    65                 if (pam_get_item(pamh, PAM_USER_PROMPT, (void **)&p) !=
    66                     PAM_SUCCESS || p == NULL)
     65                if (pam_get_item(pamh, PAM_USER_PROMPT,
     66                    (const void **)&p) != PAM_SUCCESS || p == NULL)
    6767                        prompt = "Login: ";
    6868        }
    69         r = pam_prompt(pamh, user, 0, "%s", prompt ? prompt : p);
     69        r = pam_prompt(pamh, &resp, 0, "%s", prompt ? prompt : p);
    7070        if (r != PAM_SUCCESS)
    7171                return (r);
     72        *user = resp;
    7273        return (pam_set_item(pamh, PAM_USER, *user));
    7374}
Note: See TracChangeset for help on using the changeset viewer.