summaryrefslogtreecommitdiff
path: root/libpam/pam_item.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpam/pam_item.c')
-rw-r--r--libpam/pam_item.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libpam/pam_item.c b/libpam/pam_item.c
index 52efe80b..41d90087 100644
--- a/libpam/pam_item.c
+++ b/libpam/pam_item.c
@@ -138,6 +138,24 @@ int pam_set_item (pam_handle_t *pamh, int item_type, const void *item)
pamh->fail_delay.delay_fn_ptr = item;
break;
+ case PAM_XDISPLAY:
+ RESET(pamh->xdisplay, item);
+ break;
+
+ case PAM_XAUTHDATA:
+ if (pamh->xauth.namelen) {
+ _pam_overwrite(pamh->xauth.name);
+ free(pamh->xauth.name);
+ }
+ if (pamh->xauth.datalen) {
+ _pam_overwrite_n(pamh->xauth.data, pamh->xauth.datalen);
+ free(pamh->xauth.data);
+ }
+ pamh->xauth = *((const struct pam_xauth_data *) item);
+ pamh->xauth.name = _pam_strdup(pamh->xauth.name);
+ pamh->xauth.data = _pam_memdup(pamh->xauth.data, pamh->xauth.datalen);
+ break;
+
default:
retval = PAM_BAD_ITEM;
}
@@ -220,6 +238,14 @@ int pam_get_item (const pam_handle_t *pamh, int item_type, const void **item)
*item = pamh->fail_delay.delay_fn_ptr;
break;
+ case PAM_XDISPLAY:
+ *item = pamh->xdisplay;
+ break;
+
+ case PAM_XAUTHDATA:
+ *item = &pamh->xauth;
+ break;
+
default:
retval = PAM_BAD_ITEM;
}