summaryrefslogtreecommitdiff
path: root/libpam/pam_item.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2008-12-11 19:41:49 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2008-12-11 19:41:49 +0000
commita1131337d71a61da5b3b5e129545d3257a709480 (patch)
treea2a9c49346bcb8912b31916f40f96d67479f0c36 /libpam/pam_item.c
parent300b741a23d95cd44fa391905d6edce8340c8fee (diff)
Relevant BUGIDs:
Purpose of commit: new feature Commit summary: --------------- 2008-12-10 Thorsten Kukuk <kukuk@thkukuk.de> * doc/man/pam_item_types_ext.inc.xml: Document PAM_AUTHTOK_TYPE. * libpam/pam_end.c (pam_end): Free authtok_type. * tests/tst-pam_get_item.c: Add PAM_AUTHTOK_TYPE as test case. * tests/tst-pam_set_item.c: Likewise. * libpam/pam_start.c (pam_start): Initialize xdisplay, xauth and authtok_type. * libpam/pam_get_authtok.c (pam_get_authtok): Rename "type" to "authtok_type". * modules/pam_cracklib/pam_cracklib.8.xml: Replace "type=" with "authtok_type=". * doc/man/pam_get_authtok.3.xml: Document authtok_type argument. * modules/pam_cracklib/pam_cracklib.c (pam_sm_chauthtok): Set type= argument as PAM_AUTHTOK_TYPE item. * libpam/pam_get_authtok.c (pam_get_authtok): If no type argument given, use PAM_AUTHTOK_TYPE item. * libpam/pam_item.c (pam_get_item): Fetch PAM_AUTHTOK_TYPE item. (pam_set_item): Store PAM_AUTHTOK_TYPE item. * libpam/pam_private.h: Add authtok_type to pam_handle. * libpam/include/security/_pam_types.h (PAM_AUTHTOK_TYPE): New.
Diffstat (limited to 'libpam/pam_item.c')
-rw-r--r--libpam/pam_item.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libpam/pam_item.c b/libpam/pam_item.c
index f3d794eb..ed478a4a 100644
--- a/libpam/pam_item.c
+++ b/libpam/pam_item.c
@@ -151,7 +151,7 @@ int pam_set_item (pam_handle_t *pamh, int item_type, const void *item)
if ((pamh->xauth.name=_pam_strdup(pamh->xauth.name)) == NULL) {
memset(&pamh->xauth, '\0', sizeof(pamh->xauth));
return PAM_BUF_ERR;
- }
+ }
if ((pamh->xauth.data=_pam_memdup(pamh->xauth.data,
pamh->xauth.datalen)) == NULL) {
_pam_overwrite(pamh->xauth.name);
@@ -161,6 +161,10 @@ int pam_set_item (pam_handle_t *pamh, int item_type, const void *item)
}
break;
+ case PAM_AUTHTOK_TYPE:
+ TRY_SET(pamh->authtok_type, item);
+ break;
+
default:
retval = PAM_BAD_ITEM;
}
@@ -251,6 +255,10 @@ int pam_get_item (const pam_handle_t *pamh, int item_type, const void **item)
*item = &pamh->xauth;
break;
+ case PAM_AUTHTOK_TYPE:
+ *item = pamh->authtok_type;
+ break;
+
default:
retval = PAM_BAD_ITEM;
}