]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Extend kadmin client timeout to one hour
authorGreg Hudson <ghudson@mit.edu>
Sat, 14 Mar 2015 18:21:06 +0000 (14:21 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 17 Mar 2015 18:47:17 +0000 (14:47 -0400)
Retrieving the list of principals can take a long time for some
databases.  Extend the libkadm5 client timeout from two minutes to one
hour.  (We can't easily remove the timeout entirely.)

ticket: 8027

src/lib/kadm5/clnt/client_init.c

index 7fac2a8e7a96077133c2eaf1554cc06b9778c2d9..b96cc35781543d11cb2602b4bca064948a13666b 100644 (file)
@@ -152,6 +152,7 @@ init_any(krb5_context context, char *client_name, enum init_type init_type,
     rpcvers_t rpc_vers;
     krb5_ccache ccache;
     krb5_principal client = NULL, server = NULL;
+    struct timeval timeout;
 
     kadm5_server_handle_t handle;
     kadm5_config_params params_local;
@@ -261,6 +262,12 @@ init_any(krb5_context context, char *client_name, enum init_type init_type,
 #endif
         goto error;
     }
+
+    /* Set a one-hour timeout. */
+    timeout.tv_sec = 3600;
+    timeout.tv_usec = 0;
+    (void)clnt_control(handle->clnt, CLSET_TIMEOUT, &timeout);
+
     handle->client_socket = fd;
     handle->lhandle->clnt = handle->clnt;
     handle->lhandle->client_socket = fd;