]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: Re-check the timeout in machine_password_change_handler()
authorVolker Lendecke <vl@samba.org>
Thu, 19 Nov 2009 16:14:40 +0000 (17:14 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 19 Nov 2009 18:04:39 +0000 (19:04 +0100)
Someone else might have come in between and changed the password since we
created that timed request

source3/winbindd/winbindd_dual.c

index ccb1745506695cee4fcdc40c7653f4ac87ab7cd7..904d3e4ed3d307fd1e7f4d9b8c88788de4fb1600 100644 (file)
@@ -1086,6 +1086,11 @@ static void machine_password_change_handler(struct event_context *ctx,
        DEBUG(10, ("calculate_next_machine_pwd_change returned %s\n",
                   timeval_string(talloc_tos(), &next_change, false)));
 
+       if (!timeval_expired(&next_change)) {
+               DEBUG(10, ("Someone else has already changed the pw\n"));
+               goto done;
+       }
+
        if (!winbindd_can_contact_domain(child->domain)) {
                DEBUG(10,("machine_password_change_handler: Removing myself since I "
                          "do not have an incoming trust to domain %s\n",
@@ -1129,6 +1134,7 @@ static void machine_password_change_handler(struct event_context *ctx,
                        "successfully changed machine password\n"));
        }
 
+done:
        child->machine_password_change_event = event_add_timed(winbind_event_context(), NULL,
                                                              next_change,
                                                              machine_password_change_handler,