summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-03-07 03:33:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:22 -0500
commit61fe79d02200ef4f23652efe5995c84bbacd220a (patch)
treebfd4af7968742bee23d458ed4b139a8d933bab0f /source4/dsdb
parent6a73835b0946a015d1bad0b502c35d92777d2446 (diff)
downloadsamba-61fe79d02200ef4f23652efe5995c84bbacd220a.tar.gz
samba-61fe79d02200ef4f23652efe5995c84bbacd220a.tar.bz2
samba-61fe79d02200ef4f23652efe5995c84bbacd220a.zip
r13910: Fix the 'your password has expired' on every login. We now consider
if the 'password does not expire' flag has been set, filling in the PAC and netlogon reply correctly if so. Andrew Bartlett (This used to be commit c530ab5dc6865c422382bc0afa7a86f7ec1acdf2)
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/samdb.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index 3d5535602b..fe82b380c5 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -29,6 +29,7 @@
#include "system/filesys.h"
#include "db_wrap.h"
#include "dsdb/samdb/samdb.h"
+#include "ads.h"
/*
connect to the SAM database
@@ -487,12 +488,16 @@ NTTIME samdb_result_allow_password_change(struct ldb_context *sam_ldb,
NTTIME samdb_result_force_password_change(struct ldb_context *sam_ldb,
TALLOC_CTX *mem_ctx,
const struct ldb_dn *domain_dn,
- struct ldb_message *msg,
- const char *attr)
+ struct ldb_message *msg)
{
- uint64_t attr_time = samdb_result_uint64(msg, attr, 0);
+ uint64_t attr_time = samdb_result_uint64(msg, "pwdLastSet", 0);
+ uint32_t user_flags = samdb_result_uint64(msg, "userAccountControl", 0);
int64_t maxPwdAge;
+ if (user_flags & UF_DONT_EXPIRE_PASSWD) {
+ return 0x7FFFFFFFFFFFFFFFULL;
+ }
+
if (attr_time == 0) {
return 0;
}