s3: Add some debugs to the winbind machine pwchange machinery
authorVolker Lendecke <vl@samba.org>
Thu, 19 Nov 2009 16:11:32 +0000 (17:11 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:16 +0000 (13:22 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
source3/winbindd/winbindd_dual.c

index b6287dd3ae8a4ceec7e4862a9a5655f2a4d2f6bf..badedf4dd2ea3b793381603ea579b6082e069f5d 100644 (file)
@@ -881,6 +881,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,
@@ -900,6 +901,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",
@@ -933,9 +941,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",
@@ -958,6 +970,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",