s4:torture:rpc:samr: fix password age calculation in test_ChangePasswordUser3()
authorMichael Adam <obnox@samba.org>
Tue, 11 Dec 2012 12:34:49 +0000 (13:34 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 11 Dec 2012 13:00:00 +0000 (14:00 +0100)
The min_password_age field is the negative of the age.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/torture/rpc/samr.c

index 01f4c0fdc29cde2b19e34bb205d6c7e8c2a9df1a..f17f0d746c9678519fdfb50491c9c76477e95abe 100644 (file)
@@ -2490,8 +2490,8 @@ bool test_ChangePasswordUser3(struct dcerpc_pipe *p, struct torture_context *tct
 
                Guenther */
 
-               if ((dominfo->min_password_age > 0) && !null_nttime(last_password_change) &&
-                          (last_password_change + dominfo->min_password_age > t)) {
+               if ((dominfo->min_password_age < 0) && !null_nttime(last_password_change) &&
+                          (last_password_change - dominfo->min_password_age > t)) {
 
                        if (reject->extendedFailureReason != SAM_PWD_CHANGE_NO_ERROR) {
                                torture_warning(tctx, "expected SAM_PWD_CHANGE_NO_ERROR (%d), got %d\n",