[PATCH] Add for support for pam_winbind warn_pwd_expire

Marcin Mogielnicki Marcin.Mogielnicki at redbulltechnology.com
Fri Nov 28 07:25:03 MST 2014


Hi,

This is something I keep patching for every release of samba for years, gnome login manager crashes having any messages emited by pam stack. Works against 4.2.0rc2

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.

Regards,

Marcin Mogielnicki

--- a/nsswitch/pam_winbind.c.orig       2014-11-28 13:48:04.000000000 +0000
+++ b/nsswitch/pam_winbind.c    2014-11-28 13:52:52.000000000 +0000
@@ -508,6 +508,9 @@
                        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 @@
        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;

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pam_winbind_warn_pwd_expire.patch
Type: application/octet-stream
Size: 741 bytes
Desc: pam_winbind_warn_pwd_expire.patch
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141128/e56d24a0/attachment-0001.obj>


More information about the samba-technical mailing list