From: Volker Lendecke Date: Thu, 19 Nov 2009 16:11:32 +0000 (+0100) Subject: s3: Add some debugs to the winbind machine pwchange machinery X-Git-Tag: tdb-1.2.0~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0ef9fbce63472411a20f26c0804322a07b28919;p=thirdparty%2Fsamba.git s3: Add some debugs to the winbind machine pwchange machinery --- diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index 07a49e0e088..ccb17455066 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -1019,6 +1019,7 @@ static bool calculate_next_machine_pwd_change(const char *domain, time_t pass_last_set_time; time_t timeout; time_t next_change; + struct timeval tv; char *pw; pw = secrets_fetch_machine_password(domain, @@ -1038,6 +1039,13 @@ static bool calculate_next_machine_pwd_change(const char *domain, return false; } + tv.tv_sec = pass_last_set_time; + DEBUG(10, ("password last changed %s\n", + timeval_string(talloc_tos(), &tv, false))); + tv.tv_sec += timeout; + DEBUGADD(10, ("password valid until %s\n", + timeval_string(talloc_tos(), &tv, false))); + if (time(NULL) < (pass_last_set_time + timeout)) { next_change = pass_last_set_time + timeout; DEBUG(10,("machine password still valid until: %s\n", @@ -1071,9 +1079,13 @@ static void machine_password_change_handler(struct event_context *ctx, if (!calculate_next_machine_pwd_change(child->domain->name, &next_change)) { + DEBUG(10, ("calculate_next_machine_pwd_change failed\n")); return; } + DEBUG(10, ("calculate_next_machine_pwd_change returned %s\n", + timeval_string(talloc_tos(), &next_change, false))); + 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", @@ -1096,6 +1108,10 @@ static void machine_password_change_handler(struct event_context *ctx, child->domain->name); TALLOC_FREE(frame); + DEBUG(10, ("machine_password_change_handler: " + "trust_pw_find_change_and_store_it returned %s\n", + nt_errstr(result))); + if (!NT_STATUS_IS_OK(result)) { DEBUG(10,("machine_password_change_handler: " "failed to change machine password: %s\n",