summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2014-12-03 16:55:39 +0100
committerGünther Deschner <gd@samba.org>2014-12-03 21:36:49 +0100
commit78b7db18149e7ecd484e4686461e6eb1a41ab5cb (patch)
treed4ba806a204e1a088240e60e03ec52917e475ce4 /nsswitch
parent816751a3a8ed564f2cf880fd1ca3b1e8f9c85471 (diff)
downloadsamba-78b7db18149e7ecd484e4686461e6eb1a41ab5cb.tar.gz
pam_winbind: fix warn_pwd_expire implementation.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9056 warn_pwd_expire parameter is not working as documented in pam_winbind manual page. This patch adds missing bit and allows disabling warning message fully, i.e. setting warn time to zero days. Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Dec 3 21:36:49 CET 2014 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/pam_winbind.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index f06f2b5ba83..f1b88cba4bb 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -508,6 +508,9 @@ config_from_pam:
ctrl |= WINBIND_CACHED_LOGIN;
else if (!strcasecmp(*v, "mkhomedir"))
ctrl |= WINBIND_MKHOMEDIR;
+ else if (!strncasecmp(*v, "warn_pwd_expire",
+ strlen("warn_pwd_expire")))
+ ctrl |= WINBIND_WARN_PWD_EXPIRE;
else if (type != PAM_WINBIND_CLEANUP) {
__pam_log(pamh, ctrl, LOG_ERR,
"pam_parse: unknown option: %s", *v);
@@ -2379,7 +2382,7 @@ static int get_warn_pwd_expire_from_config(struct pwb_context *ctx)
ret = get_config_item_int(ctx, "warn_pwd_expire",
WINBIND_WARN_PWD_EXPIRE);
/* no or broken setting */
- if (ret <= 0) {
+ if (ret < 0) {
return DEFAULT_DAYS_TO_WARN_BEFORE_PWD_EXPIRES;
}
return ret;