ldb-samba: critical bugfix on original recursive search implementation
[obnox/samba/samba-obnox.git] / nsswitch / wb_common.c
index 3194df197b74042f42af80f610e9645eee76ca06..262181a3cff2e5a25127e0d86ea667fe5f19fd66 100644 (file)
@@ -88,7 +88,7 @@ static void winbind_close_sock(struct winbindd_context *ctx)
 
 /* Destructor for global context to ensure fd is closed */
 
-#if HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR
+#if HAVE_DESTRUCTOR_ATTRIBUTE
 __attribute__((destructor))
 #endif
 static void winbind_destructor(void)
@@ -195,7 +195,7 @@ static int make_safe_fd(int fd)
  * @brief Check if we talk to the priviliged pipe which should be owned by root.
  *
  * This checks if we have uid_wrapper running and if this is the case it will
- * allow to connect to the winbind privileged pipe even it is not owned by root.
+ * allow one to connect to the winbind privileged pipe even it is not owned by root.
  *
  * @param[in]  uid      The uid to check if we can safely talk to the pipe.
  *
@@ -535,7 +535,7 @@ static int winbind_read_sock(struct winbindd_context *ctx,
 
                if (ret == 0) {
                        /* Not ready for read yet... */
-                       if (total_time >= 30) {
+                       if (total_time >= 300) {
                                /* Timeout */
                                winbind_close_sock(ctx);
                                return -1;
@@ -719,20 +719,16 @@ NSS_STATUS winbindd_request_response(struct winbindd_context *ctx,
                                     struct winbindd_response *response)
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
-       int count = 0;
        struct winbindd_context *wb_ctx = ctx;
 
        if (ctx == NULL) {
                wb_ctx = &wb_global_ctx;
        }
 
-       while ((status == NSS_STATUS_UNAVAIL) && (count < 10)) {
-               status = winbindd_send_request(wb_ctx, req_type, 0, request);
-               if (status != NSS_STATUS_SUCCESS)
-                       return(status);
-               status = winbindd_get_response(wb_ctx, response);
-               count += 1;
-       }
+       status = winbindd_send_request(wb_ctx, req_type, 0, request);
+       if (status != NSS_STATUS_SUCCESS)
+               return (status);
+       status = winbindd_get_response(wb_ctx, response);
 
        return status;
 }
@@ -743,20 +739,16 @@ NSS_STATUS winbindd_priv_request_response(struct winbindd_context *ctx,
                                          struct winbindd_response *response)
 {
        NSS_STATUS status = NSS_STATUS_UNAVAIL;
-       int count = 0;
        struct winbindd_context *wb_ctx = ctx;
 
        if (ctx == NULL) {
                wb_ctx = &wb_global_ctx;
        }
 
-       while ((status == NSS_STATUS_UNAVAIL) && (count < 10)) {
-               status = winbindd_send_request(wb_ctx, req_type, 1, request);
-               if (status != NSS_STATUS_SUCCESS)
-                       return(status);
-               status = winbindd_get_response(wb_ctx, response);
-               count += 1;
-       }
+       status = winbindd_send_request(wb_ctx, req_type, 1, request);
+       if (status != NSS_STATUS_SUCCESS)
+               return (status);
+       status = winbindd_get_response(wb_ctx, response);
 
        return status;
 }