summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-08-01 15:31:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:28 -0500
commitec17ea6b069fee0dca351dc53bcbb1c2ebaa0690 (patch)
tree8bc1f437ebc6807a583c352aa011e372e8b51b3e /source3/nsswitch
parent41449a85e64325d16c63ea4e6ee57254c8aac996 (diff)
downloadsamba-ec17ea6b069fee0dca351dc53bcbb1c2ebaa0690.tar.gz
samba-ec17ea6b069fee0dca351dc53bcbb1c2ebaa0690.tar.bz2
samba-ec17ea6b069fee0dca351dc53bcbb1c2ebaa0690.zip
r17366: Save the logon script path from the info3 in the PAM session allowing
other PAM modules to pick it up from there. Guenther (This used to be commit b3ac5a586ba37b1122b0dc941dfee648fc4fa6d5)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/pam_winbind.c22
-rw-r--r--source3/nsswitch/pam_winbind.h1
2 files changed, 19 insertions, 4 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index f96dd0ee9b..1aef5c6c4a 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -503,13 +503,27 @@ static int winbind_auth_request(pam_handle_t * pamh,
/* save the CIFS homedir for pam_cifs / pam_mount */
if (response.data.auth.info3.home_dir[0] != '\0') {
- char *buf;
- if (!asprintf(&buf, "%s", response.data.auth.info3.home_dir)) {
- return PAM_BUF_ERR;
+ int ret2 = pam_set_data(pamh, PAM_WINBIND_HOMEDIR,
+ (void *) strdup(response.data.auth.info3.home_dir),
+ _pam_winbind_cleanup_func);
+ if (ret2) {
+ _pam_log_debug(ctrl, LOG_DEBUG, "Could not set data: %s",
+ pam_strerror(pamh, ret2));
}
- pam_set_data( pamh, PAM_WINBIND_HOMEDIR, (void *)buf, _pam_winbind_cleanup_func);
+ }
+
+ /* save the logon script path for other PAM modules */
+ if (response.data.auth.info3.logon_script[0] != '\0') {
+
+ int ret2 = pam_set_data(pamh, PAM_WINBIND_LOGONSCRIPT,
+ (void *) strdup(response.data.auth.info3.logon_script),
+ _pam_winbind_cleanup_func);
+ if (ret2) {
+ _pam_log_debug(ctrl, LOG_DEBUG, "Could not set data: %s",
+ pam_strerror(pamh, ret2));
+ }
}
return ret;
diff --git a/source3/nsswitch/pam_winbind.h b/source3/nsswitch/pam_winbind.h
index fb2769d1c1..2b7080182b 100644
--- a/source3/nsswitch/pam_winbind.h
+++ b/source3/nsswitch/pam_winbind.h
@@ -108,6 +108,7 @@ do { \
#define PAM_WINBIND_NEW_AUTHTOK_REQD "PAM_WINBIND_NEW_AUTHTOK_REQD"
#define PAM_WINBIND_HOMEDIR "PAM_WINBIND_HOMEDIR"
+#define PAM_WINBIND_LOGONSCRIPT "PAM_WINBIND_LOGONSCRIPT"
#define PAM_WINBIND_PWD_LAST_SET "PAM_WINBIND_PWD_LAST_SET"
#define SECONDS_PER_DAY 86400