summaryrefslogtreecommitdiff
path: root/source3/utils/smbcacls.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-10-21 17:22:03 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-11-15 11:00:26 +0100
commitd6d8893d56d0f7b6be7e9a8c34d454f4933525d5 (patch)
tree637d50d8291817563ce31dbfc3ccdc8fd5093031 /source3/utils/smbcacls.c
parentd134f57ccf76bf7b09272d3c58a786e7b881934f (diff)
downloadsamba-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/utils/smbcacls.c')
-rw-r--r--source3/utils/smbcacls.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 5cb707d2d7d..8d775271617 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -733,7 +733,7 @@ static int inherit(struct cli_state *cli, const char *filename,
/*****************************************************
Return a connection to a server.
*******************************************************/
-static struct cli_state *connect_one(struct user_auth_info *auth_info,
+static struct cli_state *connect_one(const struct user_auth_info *auth_info,
const char *server, const char *share)
{
struct cli_state *c = NULL;
@@ -745,13 +745,6 @@ static struct cli_state *connect_one(struct user_auth_info *auth_info,
CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS;
}
- if (get_cmdline_auth_info_use_machine_account(auth_info) &&
- !set_cmdline_auth_info_machine_account_creds(auth_info)) {
- return NULL;
- }
-
- set_cmdline_auth_info_getpass(auth_info);
-
nt_status = cli_full_connection(&c, lp_netbios_name(), server,
NULL, 0,
share, "?????",
@@ -829,7 +822,6 @@ int main(int argc, char *argv[])
TALLOC_CTX *frame = talloc_stackframe();
const char *owner_username = "";
char *server;
- struct user_auth_info *auth_info;
smb_init_locale();
@@ -839,13 +831,6 @@ int main(int argc, char *argv[])
setlinebuf(stdout);
-
- auth_info = user_auth_info_init(frame);
- if (auth_info == NULL) {
- exit(1);
- }
- popt_common_set_auth_info(auth_info);
-
pc = poptGetContext("smbcacls", argc, argv_const, long_options, 0);
poptSetOtherOptionHelp(pc, "//server1/share1 filename\nACLs look like: "
@@ -936,7 +921,7 @@ int main(int argc, char *argv[])
share++;
if (!test_args) {
- cli = connect_one(auth_info, server, share);
+ cli = connect_one(cmdline_auth_info, server, share);
if (!cli) {
exit(EXIT_FAILED);
}