summaryrefslogtreecommitdiff
path: root/libpam
diff options
context:
space:
mode:
Diffstat (limited to 'libpam')
-rw-r--r--libpam/pam_env.c2
-rw-r--r--libpam/pam_item.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/libpam/pam_env.c b/libpam/pam_env.c
index ae1ddf2e..0e08cbdd 100644
--- a/libpam/pam_env.c
+++ b/libpam/pam_env.c
@@ -344,7 +344,7 @@ static char **_copy_env(pam_handle_t *pamh)
_pam_overwrite(dump[i]);
_pam_drop(dump[i]);
}
- __pam_drop(dump);
+ _pam_drop(dump);
return NULL;
}
}
diff --git a/libpam/pam_item.c b/libpam/pam_item.c
index 47686411..230f5068 100644
--- a/libpam/pam_item.c
+++ b/libpam/pam_item.c
@@ -158,6 +158,8 @@ int pam_get_item (const pam_handle_t *pamh, int item_type, const void **item)
"pam_get_item: nowhere to place requested item");
return PAM_PERM_DENIED;
}
+ else
+ *item = NULL;
switch (item_type) {
case PAM_SERVICE:
@@ -238,6 +240,12 @@ int pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt)
struct pam_response *resp;
D(("called."));
+ if (user == NULL) { /* ensure that the module has supplied a destination */
+ _pam_system_log(LOG_ERR, "pam_get_user: nowhere to record username");
+ return PAM_PERM_DENIED;
+ } else
+ *user = NULL;
+
IF_NO_PAMH("pam_get_user", pamh, PAM_SYSTEM_ERR);
if (pamh->pam_conversation == NULL) {
@@ -245,12 +253,6 @@ int pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt)
return PAM_SERVICE_ERR;
}
- if (user == NULL) { /* ensure the the module has suplied a destination */
- _pam_system_log(LOG_ERR, "pam_get_user: nowhere to record username");
- return PAM_PERM_DENIED;
- } else
- *user = NULL;
-
if (pamh->user) { /* have one so return it */
*user = pamh->user;
return PAM_SUCCESS;