dsdb/mod/operational: correct comment arithmetic
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 23 Oct 2020 03:30:25 +0000 (16:30 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 3 Nov 2020 00:33:41 +0000 (00:33 +0000)
E + F is not 1F! E + F is 1D!

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/operational.c

index 50e913cdd5c19ec4992f0c6023f35b4e33d81ac5..3c0bd039d56d6591cf6c64d1e563394e44d1b3ce 100644 (file)
@@ -797,7 +797,10 @@ static NTTIME get_msds_user_password_expiry_time_computed(struct ldb_module *mod
         *
         * 0x7FFFFFFFFFFFFFFEULL + 0x7FFFFFFFFFFFFFFFULL
         * =
-        * 0xFFFFFFFFFFFFFFFFULL
+        * 0xFFFFFFFFFFFFFFFDULL
+        *
+        * or to put it another way, adding two numbers less than 1<<63 can't
+        * ever be more than 1<<64, therefore this result can't wrap.
         */
        ret = (NTTIME)pwdLastSet - (NTTIME)maxPwdAge;
        if (ret >= 0x7FFFFFFFFFFFFFFFULL) {