Changeset 38 in openpam for trunk/lib/pam_get_authtok.c


Ignore:
Timestamp:
Feb 6, 2002, 4:03:39 PM (17 years ago)
Author:
Dag-Erling Smørgrav
Message:

Constify.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_get_authtok.c

    r24 r38  
    4949int
    5050pam_get_authtok(pam_handle_t *pamh,
    51         char **authtok,
     51        const char **authtok,
    5252        const char *prompt)
    5353{
    54         char *p;
     54        char *p, *resp;
    5555        int r;
    5656
     
    5858                return (PAM_SYSTEM_ERR);
    5959
    60         r = pam_get_item(pamh, PAM_AUTHTOK, (void **)authtok);
     60        r = pam_get_item(pamh, PAM_AUTHTOK, (const void **)authtok);
    6161        if (r == PAM_SUCCESS)
    6262                return (PAM_SUCCESS);
    6363        if (prompt == NULL) {
    64                 if (pam_get_item(pamh, PAM_AUTHTOK_PROMPT, (void **)&p) !=
    65                     PAM_SUCCESS || p == NULL)
     64                if (pam_get_item(pamh, PAM_AUTHTOK_PROMPT,
     65                    (const void **)&p) != PAM_SUCCESS || p == NULL)
    6666                        prompt = "Password:";
    6767        }
    68         r = pam_prompt(pamh, authtok, 0, "%s", prompt ? prompt : p);
     68        r = pam_prompt(pamh, &resp, 0, "%s", prompt ? prompt : p);
    6969        if (r != PAM_SUCCESS)
    7070                return (r);
     71        *authtok = resp;
    7172        return (pam_set_item(pamh, PAM_AUTHTOK, *authtok));
    7273}
Note: See TracChangeset for help on using the changeset viewer.