]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Use portable integer constant INT64_MAX
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 4 Dec 2023 03:24:15 +0000 (16:24 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 8 Dec 2023 02:28:33 +0000 (02:28 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/common/util.c

index 46b6126dcf031cf7bf53a5a485ea3577fd0737c8..7030d9c025af01b842f06b9fc22eaf4fc14d49f6 100644 (file)
@@ -465,7 +465,7 @@ NTTIME samdb_result_nttime(const struct ldb_message *msg, const char *attr,
 /*
  * 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
+ * it returns INT64_MAX, not returning this value in this case
  * cause windows 2008 and newer version to fail for SMB requests
  */
 NTTIME samdb_result_last_logoff(const struct ldb_message *msg)
@@ -473,17 +473,17 @@ NTTIME samdb_result_last_logoff(const struct ldb_message *msg)
        NTTIME ret = ldb_msg_find_attr_as_uint64(msg, "lastLogoff",0);
 
        if (ret == 0)
-               ret = 0x7FFFFFFFFFFFFFFFULL;
+               ret = INT64_MAX;
 
        return ret;
 }
 
 /*
- * Windows uses both 0 and 9223372036854775807 (0x7FFFFFFFFFFFFFFFULL) to
+ * Windows uses both 0 and 9223372036854775807 (INT64_MAX) to
  * indicate an account doesn't expire.
  *
  * When Windows initially creates an account, it sets
- * accountExpires = 9223372036854775807 (0x7FFFFFFFFFFFFFFF).  However,
+ * accountExpires = 9223372036854775807 (INT64_MAX).  However,
  * when changing from an account having a specific expiration date to
  * that account never expiring, it sets accountExpires = 0.
  *
@@ -496,7 +496,7 @@ NTTIME samdb_result_account_expires(const struct ldb_message *msg)
                                                 0);
 
        if (ret == 0)
-               ret = 0x7FFFFFFFFFFFFFFFULL;
+               ret = INT64_MAX;
 
        return ret;
 }