s3:popt_common: simplify popt_common_credentials handling
[samba.git] / source3 / utils / smbcacls.c
index 5cb707d2d7d7c581fe24f5d48d95ea9074adb9c5..8d775271617ac9569f2230831c02152b7fe2da49 100644 (file)
@@ -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);
                }