]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Use portable integer constant INT64_MIN
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 4 Dec 2023 01:34:37 +0000 (14:34 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 8 Dec 2023 02:28:33 +0000 (02:28 +0000)
Because it is written in hexadecimal, ‘0x8000000000000000LL’ is likely
going to be represented as an ‘unsigned long long int’. Negating it
actually will not change its value at all, so the unary minus achieves
nothing here.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/operational.c

index f1f2c3d4ece5f20d2e8d9e0a48787b9a808d2df6..625e676165b96b80ae24d016840022873575dcfc 100644 (file)
@@ -785,7 +785,7 @@ static NTTIME get_msds_user_password_expiry_time_computed(struct ldb_module *mod
         *
         * maxPwdAge: -864000000001
         * to
-        * maxPwdAge: -9223372036854775808 (-0x8000000000000000ULL)
+        * maxPwdAge: -9223372036854775808 (INT64_MIN)
         *
         */
        maxPwdAge = get_user_max_pwd_age(module, msg, parent, domain_dn);
@@ -796,12 +796,12 @@ static NTTIME get_msds_user_password_expiry_time_computed(struct ldb_module *mod
                return 0x7FFFFFFFFFFFFFFFULL;
        }
 
-       if (maxPwdAge == -0x8000000000000000LL) {
+       if (maxPwdAge == INT64_MIN) {
                return 0x7FFFFFFFFFFFFFFFULL;
        }
 
        /*
-        * Note we already caught maxPwdAge == -0x8000000000000000ULL
+        * Note we already caught maxPwdAge == INT64_MIN
         * and pwdLastSet >= 0x7FFFFFFFFFFFFFFFULL above.
         *
         * Remember maxPwdAge is a negative number,