summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2009-08-01 14:02:58 +0400
committerAndrew Bartlett <abartlet@samba.org>2009-08-03 14:08:15 +1000
commitc50dff4ccea48de81815e0b92066b89b2bf3ddec (patch)
tree9cce5deae410f6b9fd843e742a1537d17716701e /source4/dsdb
parente21519403318acea3424516afc12730fe9e9d432 (diff)
downloadsamba-c50dff4ccea48de81815e0b92066b89b2bf3ddec.tar.gz
samba-c50dff4ccea48de81815e0b92066b89b2bf3ddec.tar.bz2
samba-c50dff4ccea48de81815e0b92066b89b2bf3ddec.zip
Return infinite time for last last logoff when last logoff = 0
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 247aec7035..5c5386b64c 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -436,6 +436,22 @@ NTTIME samdb_result_nttime(struct ldb_message *msg, const char *attr, NTTIME def
}
/*
+ * Windows stores 0 for lastLogoff.
+ * But when a MS DC return the lastLogoff (as Logoff Time)
+ * it returns 0x7FFFFFFFFFFFFFFF, not returning this value in this case
+ * cause windows 2008 and newer version to fail for SMB requests
+ */
+NTTIME samdb_result_last_logoff(struct ldb_message *msg)
+{
+ NTTIME ret = ldb_msg_find_attr_as_uint64(msg, "lastLogoff",0);
+
+ if (ret == 0)
+ ret = 0x7FFFFFFFFFFFFFFFULL;
+
+ return ret;
+}
+
+/*
* Windows uses both 0 and 9223372036854775807 (0x7FFFFFFFFFFFFFFFULL) to
* indicate an account doesn't expire.
*