diff options
author | Stefan Metzmacher <metze@samba.org> | 2016-10-21 17:22:03 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-11-15 11:00:26 +0100 |
commit | d6d8893d56d0f7b6be7e9a8c34d454f4933525d5 (patch) | |
tree | 637d50d8291817563ce31dbfc3ccdc8fd5093031 /source3/rpcclient | |
parent | d134f57ccf76bf7b09272d3c58a786e7b881934f (diff) | |
download | samba-d6d8893d56d0f7b6be7e9a8c34d454f4933525d5.tar.gz |
s3:popt_common: simplify popt_common_credentials handling
This offers a global 'struct user_auth_info *cmdline_auth_info',
similar to the 'cmdline_credentials' we have in
source4/lib/cmdline/popt_common.c.
And we create that in the POPT_CALLBACK_REASON_PRE stage
and finalize it in the POPT_CALLBACK_REASON_POST stage.
That means much less boring work for the callers
and more freedom to change the user_auth_info internals
in future.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/rpcclient.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index 554620b0380..a38c141b425 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -974,12 +974,6 @@ out_free: setup_logging("rpcclient", DEBUG_STDOUT); lp_set_cmdline("log level", "0"); - rpcclient_auth_info = user_auth_info_init(frame); - if (rpcclient_auth_info == NULL) { - exit(1); - } - popt_common_set_auth_info(rpcclient_auth_info); - /* Parse options */ pc = poptGetContext("rpcclient", argc, const_argv, @@ -1018,6 +1012,7 @@ out_free: poptFreeContext(pc); popt_burn_cmdline_password(argc, argv); + rpcclient_auth_info = cmdline_auth_info; /* Load smb.conf file */ @@ -1051,14 +1046,6 @@ out_free: * from stdin if necessary */ - if (get_cmdline_auth_info_use_machine_account(rpcclient_auth_info) && - !set_cmdline_auth_info_machine_account_creds(rpcclient_auth_info)) { - result = 1; - goto done; - } - - set_cmdline_auth_info_getpass(rpcclient_auth_info); - if ((server[0] == '/' && server[1] == '/') || (server[0] == '\\' && server[1] == '\\')) { server += 2; |