summaryrefslogtreecommitdiff
path: root/pam/pam.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-11-25 18:27:36 +0100
committerArthur de Jong <arthur@arthurdejong.org>2013-11-25 18:27:36 +0100
commit23a41ce888caaea871bf3c20c83136e3f6002f2a (patch)
tree4dc034b08ddbd8acc2a08fc79a06d55f0471ef7d /pam/pam.c
parent81bfb8bac4b32f27a187f92dde6c8f83c738d83d (diff)
Add a test for pam_get_item() argument type
This checks whether pam_get_item() takes a const void ** or void ** item value argument and defines a PAM_ITEM_CONST macro that is const when it should. This avoids some compiler warnings.
Diffstat (limited to 'pam/pam.c')
-rw-r--r--pam/pam.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pam/pam.c b/pam/pam.c
index 36caf11..3068e2a 100644
--- a/pam/pam.c
+++ b/pam/pam.c
@@ -228,7 +228,7 @@ static int init(pam_handle_t *pamh, struct pld_cfg *cfg, struct pld_ctx **ctx,
if (rc != PAM_SUCCESS)
return rc;
/* get service name */
- rc = pam_get_item(pamh, PAM_SERVICE, (const void **)service);
+ rc = pam_get_item(pamh, PAM_SERVICE, (PAM_ITEM_CONST void **)service);
if (rc != PAM_SUCCESS)
{
pam_syslog(pamh, LOG_ERR, "failed to get service name: %s",
@@ -236,9 +236,9 @@ static int init(pam_handle_t *pamh, struct pld_cfg *cfg, struct pld_ctx **ctx,
return rc;
}
/* get more PAM information (ignore errors) */
- pam_get_item(pamh, PAM_RUSER, (const void **)ruser);
- pam_get_item(pamh, PAM_RHOST, (const void **)rhost);
- pam_get_item(pamh, PAM_TTY, (const void **)tty);
+ pam_get_item(pamh, PAM_RUSER, (PAM_ITEM_CONST void **)ruser);
+ pam_get_item(pamh, PAM_RHOST, (PAM_ITEM_CONST void **)rhost);
+ pam_get_item(pamh, PAM_TTY, (PAM_ITEM_CONST void **)tty);
return PAM_SUCCESS;
}
@@ -746,7 +746,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
return remap_pam_rc(resp.res, &cfg);
}
/* get the old password (from the previous call) */
- rc = pam_get_item(pamh, PAM_OLDAUTHTOK, (const void **)&oldpassword);
+ rc = pam_get_item(pamh, PAM_OLDAUTHTOK, (PAM_ITEM_CONST void **)&oldpassword);
if (rc != PAM_SUCCESS)
return rc;
/* prompt for new password */