Bug 3783 - "wbinfo -t" fails periodically
Summary: "wbinfo -t" fails periodically
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: winbind (show other bugs)
Version: 3.0.20
Hardware: Other Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 18:15 UTC by Leon Vernikov
Modified: 2006-05-18 19:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leon Vernikov 2006-05-17 18:15:52 UTC
# wbinfo -V
Version 3.0.20
# wbinfo -t
checking the trust secret via RPC calls succeeded
# date
Wed May 17 22:50:13 UTC 2006
# wbinfo -t
checking the trust secret via RPC calls failed
error code was NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND (0xc0000233)
Could not check secret
# date
Wed May 17 23:05:45 UTC 2006
# wbinfo -t
checking the trust secret via RPC calls failed
error code was NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND (0xc0000233)
Could not check secret
# date
Wed May 17 23:07:33 UTC 2006
# wbinfo -t
checking the trust secret via RPC calls succeeded
# date
Wed May 17 23:12:13 UTC 2006

Registration "net ads join" has been done successfully.
All config files are correct.
There are no changes in environment/server/client configuration.
Client runs on Linux machine
AD server is Win2K3 SP1

The same problem is applicable to samba 3.0.21b
Comment 1 Leon Vernikov 2006-05-17 18:23:24 UTC
proposed patch

Index: samba-3.0.20/source/lib/util_sock.c
===================================================================
--- source/lib/.CC/cache/util_sock.c@@/main/pegasus_eft_br/2    Wed May 17 14:49:22 2006
+++ source/lib/util_sock.c      Wed May 17 16:15:07 2006
@@ -928,6 +928,7 @@
        fd_set r_fds, wr_fds;
        struct timeval tv;
        int maxfd;
+        time_t timestamp;
 
        int connect_loop = 10000; /* 10 milliseconds */
 
@@ -998,13 +999,21 @@
                        maxfd = sockets[i];
        }
 
-       tv.tv_sec = 0;
+       tv.tv_sec = 2;
        tv.tv_usec = connect_loop;
 
+       timestamp = time(NULL);
+ repeat_select:
        res = sys_select(maxfd+1, &r_fds, &wr_fds, NULL, &tv);
 
-       if (res < 0)
+       if (res < 0) {
+               if (errno == EINTR) {
+                       if (timestamp + 2 > time(NULL) ) {
+                               goto repeat_select;
+                       }
+               }
                goto done;
+        }
 
        if (res == 0)
                goto next_round;
Comment 2 Jeremy Allison 2006-05-17 20:12:40 UTC
Actually a simpler patch would be to change sys_select to sys_select_intr in the function open_any_socket_out() in lib/util_sock.c.
I'll check that in and get feedback from Gunther and Volker.
Jeremy.
Comment 3 Jeremy Allison 2006-05-18 19:07:07 UTC
Should be fixed for 3.0.23.
Jeremy.