[PATCH] Add for support for pam_winbind warn_pwd_expire

Andreas Schneider asn at samba.org
Wed Dec 3 08:15:01 MST 2014


On Friday 28 November 2014 14:25:03 Marcin Mogielnicki wrote:
> 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.

This looks fine for me. RB+


Günther?


> 
> --- 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
> ______________________________________________________________________

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list