]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth/sam: don't update lastLogon just because it's 0 currently
authorStefan Metzmacher <metze@samba.org>
Wed, 3 Feb 2016 18:33:51 +0000 (19:33 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 30 Jun 2016 01:30:24 +0000 (03:30 +0200)
Non interactive logons doesn't trigger an update
unless the (effective) badPwdCount is not 0 and lockoutTime is 0.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/sam.c

index 7d3e075534072956bada1ab5bc02b1855212cf03..302a4e9b4f17c6173324cec3a19f74b2dd9e8d61 100644 (file)
@@ -808,7 +808,6 @@ NTSTATUS authsam_logon_success_accounting(struct ldb_context *sam_ctx,
        struct timeval tv_now;
        NTTIME now;
        NTTIME lastLogonTimestamp;
-       NTTIME lastLogon;
 
        mem_ctx = talloc_new(msg);
        if (mem_ctx == NULL) {
@@ -824,7 +823,6 @@ NTSTATUS authsam_logon_success_accounting(struct ldb_context *sam_ctx,
        }
        lastLogonTimestamp =
                ldb_msg_find_attr_as_int64(msg, "lastLogonTimestamp", 0);
-       lastLogon = ldb_msg_find_attr_as_int64(msg, "lastLogon", 0);
 
        DEBUG(5, ("lastLogonTimestamp is %lld\n",
                  (long long int)lastLogonTimestamp));
@@ -856,7 +854,7 @@ NTSTATUS authsam_logon_success_accounting(struct ldb_context *sam_ctx,
        tv_now = timeval_current();
        now = timeval_to_nttime(&tv_now);
 
-       if (interactive_or_kerberos || lastLogon == 0 ||
+       if (interactive_or_kerberos ||
            (badPwdCount != 0 && lockoutTime == 0)) {
                ret = samdb_msg_add_int64(sam_ctx, msg_mod, msg_mod,
                                          "lastLogon", now);