From 4d0ebc90dce05a66736c070d97d01c4167265a9a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 19 Nov 2009 17:14:40 +0100 Subject: s3: Re-check the timeout in machine_password_change_handler() Someone else might have come in between and changed the password since we created that timed request --- source3/winbindd/winbindd_dual.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3') diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index ccb1745506..904d3e4ed3 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -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, -- cgit