summaryrefslogtreecommitdiff
path: root/source3/utils/smbtree.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-12-14 13:06:19 +0100
committerVolker Lendecke <vl@samba.org>2008-12-14 14:00:43 +0100
commitdaeb3a190d16a5bc05be63b2b136ebe65d6f6cf7 (patch)
tree80ed13d20c756a84b645257d7fcc63e905a75b57 /source3/utils/smbtree.c
parent31f157a04b2f26537c9da4aa39bdcdde7b41e64b (diff)
downloadsamba-daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7.tar.gz
samba-daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7.tar.bz2
samba-daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7.zip
Remove the global "cmdline_auth_info" from source3/lib/util.c
This involves changing all our clients, that's why it's so large.
Diffstat (limited to 'source3/utils/smbtree.c')
-rw-r--r--source3/utils/smbtree.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c
index 9fc02bac13..6c69300e85 100644
--- a/source3/utils/smbtree.c
+++ b/source3/utils/smbtree.c
@@ -272,7 +272,7 @@ static bool print_tree(struct user_auth_info *user_info)
int main(int argc,char *argv[])
{
TALLOC_CTX *frame = talloc_stackframe();
- struct user_auth_info local_auth_info;
+ struct user_auth_info *auth_info;
struct poptOption long_options[] = {
POPT_AUTOHELP
{ "broadcast", 'b', POPT_ARG_VAL, &use_bcast, True, "Use broadcast instead of using the master browser" },
@@ -293,6 +293,12 @@ static bool print_tree(struct user_auth_info *user_info)
setup_logging(argv[0],True);
+ auth_info = user_auth_info_init(frame);
+ if (auth_info == NULL) {
+ exit(1);
+ }
+ popt_common_set_auth_info(auth_info);
+
pc = poptGetContext("smbtree", argc, (const char **)argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
while(poptGetNextOpt(pc) != -1);
@@ -303,26 +309,22 @@ static bool print_tree(struct user_auth_info *user_info)
/* Parse command line args */
- if (get_cmdline_auth_info_use_machine_account() &&
- !set_cmdline_auth_info_machine_account_creds()) {
+ if (get_cmdline_auth_info_use_machine_account(auth_info) &&
+ !set_cmdline_auth_info_machine_account_creds(auth_info)) {
TALLOC_FREE(frame);
return 1;
}
- if (!get_cmdline_auth_info_got_pass()) {
+ if (!get_cmdline_auth_info_got_pass(auth_info)) {
char *pass = getpass("Password: ");
if (pass) {
- set_cmdline_auth_info_password(pass);
+ set_cmdline_auth_info_password(auth_info, pass);
}
}
/* Now do our stuff */
- if (!get_cmdline_auth_info_copy(&local_auth_info)) {
- return 1;
- }
-
- if (!print_tree(&local_auth_info)) {
+ if (!print_tree(auth_info)) {
TALLOC_FREE(frame);
return 1;
}