From: Stefan Metzmacher Date: Thu, 26 Mar 2009 19:32:55 +0000 (+0100) Subject: s3:net: add --request-timeout option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=340c23e150061a20af72e9b9a1762d288660861c;p=thirdparty%2Fsamba.git s3:net: add --request-timeout option metze (cherry picked from commit 257809558bfab3e45703cf8be76357596392a3ea) (cherry picked from commit e20b8706401d1a4eee0fe494825deef6ab23ab23) (cherry picked from commit d80e02de5714aaa650bef91767ce0775bd2392f5) --- diff --git a/source/utils/net.c b/source/utils/net.c index 7c616125402..570051123ad 100644 --- a/source/utils/net.c +++ b/source/utils/net.c @@ -72,6 +72,7 @@ const char *opt_comment = ""; const char *opt_container = NULL; int opt_flags = -1; int opt_timeout = 0; +int opt_request_timeout = 0; const char *opt_target_workgroup = NULL; int opt_machine_pass = 0; int opt_localgroup = False; @@ -571,6 +572,8 @@ NTSTATUS net_make_ipc_connection_ex(const char *domain, const char *server, d_fprintf(stderr, "Connection failed: %s\n", nt_errstr(nt_status)); cli = NULL; + } else if (opt_request_timeout) { + cli_set_timeout(cli, opt_request_timeout * 1000); } done: @@ -1042,6 +1045,7 @@ static struct functable net_func[] = { {"force", 'f', POPT_ARG_NONE, &opt_force}, {"stdin", 'i', POPT_ARG_NONE, &opt_stdin}, {"timeout", 't', POPT_ARG_INT, &opt_timeout}, + {"request-timeout",0,POPT_ARG_INT, &opt_request_timeout}, {"machine-pass",'P', POPT_ARG_NONE, &opt_machine_pass}, {"myworkgroup", 'W', POPT_ARG_STRING, &opt_workgroup}, {"verbose", 'v', POPT_ARG_NONE, &opt_verbose}, diff --git a/source/utils/net.h b/source/utils/net.h index f0436688ab3..7786b26ed9f 100644 --- a/source/utils/net.h +++ b/source/utils/net.h @@ -100,6 +100,7 @@ extern int opt_reboot; extern int opt_force; extern int opt_machine_pass; extern int opt_timeout; +extern int opt_request_timeout; extern const char *opt_host; extern const char *opt_user_name; extern const char *opt_password; diff --git a/source/utils/net_help.c b/source/utils/net_help.c index c4accf01162..6554364a416 100644 --- a/source/utils/net_help.c +++ b/source/utils/net_help.c @@ -48,7 +48,8 @@ int net_common_flags_usage(int argc, const char **argv) d_printf("\t-l or --long\t\t\tDisplay full information\n"); d_printf("\t-V or --version\t\t\tPrint samba version information\n"); d_printf("\t-P or --machine-pass\t\tAuthenticate as machine account\n"); - d_printf("\t-e or --encrypt\t\tEncrypt SMB transport (UNIX extended servers only)\n"); + d_printf("\t-e or --encrypt\t\t\tEncrypt SMB transport (UNIX extended servers only)\n"); + d_printf("\t--request-timeout\t\tThe timeout for smb and rpc requests in seconds\n"); return -1; }