s4:dsdb: Fix integer operations
authorAndreas Schneider <asn@samba.org>
Thu, 7 Dec 2017 16:32:36 +0000 (17:32 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 20 Mar 2018 22:16:16 +0000 (23:16 +0100)
This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/operational.c

index 08a8454eca6f6ff8675a6d2627b5803ba9dfd0e7..576cf8615740e27ec6704b77db8f891bc0dae553 100644 (file)
@@ -699,7 +699,7 @@ static NTTIME get_msds_user_password_expiry_time_computed(struct ldb_module *mod
                return 0x7FFFFFFFFFFFFFFFULL;
        }
 
-       if (pwdLastSet >= 0x7FFFFFFFFFFFFFFFULL) {
+       if (pwdLastSet >= 0x7FFFFFFFFFFFFFFFLL) {
                /*
                 * Somethings wrong with the clock...
                 */
@@ -725,7 +725,7 @@ static NTTIME get_msds_user_password_expiry_time_computed(struct ldb_module *mod
                return 0x7FFFFFFFFFFFFFFFULL;
        }
 
-       if (maxPwdAge == -0x8000000000000000ULL) {
+       if (maxPwdAge == -0x8000000000000000LL) {
                return 0x7FFFFFFFFFFFFFFFULL;
        }
 
@@ -740,7 +740,7 @@ static NTTIME get_msds_user_password_expiry_time_computed(struct ldb_module *mod
         * =
         * 0xFFFFFFFFFFFFFFFFULL
         */
-       ret = pwdLastSet - maxPwdAge;
+       ret = (NTTIME)pwdLastSet - (NTTIME)maxPwdAge;
        if (ret >= 0x7FFFFFFFFFFFFFFFULL) {
                return 0x7FFFFFFFFFFFFFFFULL;
        }