Preventing annoying "password will expire" message if password ne ver expires / bug 2836

Beschorner Daniel Daniel.Beschorner at facton.com
Tue Oct 11 09:28:47 GMT 2005


Would something like this be the right way?
Windows seems to return time_min in this case.

Daniel


--- samba-3.0.20a/source/passdb/pdb_get_set.c   2005-08-31
10:38:11.000000000 +0200
+++ samba-3.0.20a-patched/source/passdb/pdb_get_set.c   2005-09-12
19:17:19.000000000 +0200
@@ -98,8 +98,12 @@

 time_t pdb_get_pass_must_change_time (const SAM_ACCOUNT *sampass)
 {
-       if (sampass)
-               return (sampass->private_u.pass_must_change_time);
+       if (sampass) {
+               if (pdb_get_acct_ctrl(sampass) & ACB_PWNOEXP)
+                       return get_time_t_min();
+               else
+                       return (sampass->private_u.pass_must_change_time);
+       }
        else
                return (-1);
 }


More information about the samba-technical mailing list