summaryrefslogtreecommitdiff
path: root/examples/fuse
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 /examples/fuse
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 'examples/fuse')
-rw-r--r--examples/fuse/smb2mount.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/examples/fuse/smb2mount.c b/examples/fuse/smb2mount.c
index 2c06ed56376..b90e1151094 100644
--- a/examples/fuse/smb2mount.c
+++ b/examples/fuse/smb2mount.c
@@ -25,7 +25,7 @@
#include "libsmb/proto.h"
#include "clifuse.h"
-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;
@@ -37,13 +37,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, "?????",
@@ -78,7 +71,6 @@ int main(int argc, char *argv[])
{
const char **argv_const = discard_const_p(const char *, argv);
TALLOC_CTX *frame = talloc_stackframe();
- struct user_auth_info *auth_info;
poptContext pc;
int opt, ret;
char *unc, *mountpoint, *server, *share;
@@ -96,12 +88,6 @@ int main(int argc, char *argv[])
lp_set_cmdline("client min protocol", "SMB2");
lp_set_cmdline("client max protocol", "SMB3_11");
- auth_info = user_auth_info_init(frame);
- if (auth_info == NULL) {
- exit(1);
- }
- popt_common_set_auth_info(auth_info);
-
lp_load_global(get_dyn_CONFIGFILE());
load_interfaces();
@@ -151,7 +137,7 @@ int main(int argc, char *argv[])
*share = 0;
share++;
- cli = connect_one(auth_info, server, share);
+ cli = connect_one(cmdline_auth_info, server, share);
if (cli == NULL) {
return -1;
}