summaryrefslogtreecommitdiff
path: root/source4/torture/shell.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-05-09 16:10:03 -0700
committerJeremy Allison <jra@samba.org>2017-05-11 20:30:13 +0200
commitb2de5a81bf2e5a79b101859c738fc057af7308ed (patch)
tree439e0d660e3ab059deb4b0108170f3a31a9a8d70 /source4/torture/shell.c
parentdd4a3ce92792c4687f92d4b9e88f7bbee6cad593 (diff)
downloadsamba-b2de5a81bf2e5a79b101859c738fc057af7308ed.tar.gz
s4: popt: Global replace of cmdline_credentials -> popt_get_cmdline_credentials().
Add one use of popt_set_cmdline_credentials(). Fix 80 column limits when cmdline_credentials changes to popt_get_cmdline_credentials(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4/torture/shell.c')
-rw-r--r--source4/torture/shell.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/source4/torture/shell.c b/source4/torture/shell.c
index cf561353731..5a4eb5c1d6a 100644
--- a/source4/torture/shell.c
+++ b/source4/torture/shell.c
@@ -110,7 +110,8 @@ void torture_shell(struct torture_context *tctx)
* stops the credentials system prompting when we use the "auth"
* command to display the current auth parameters.
*/
- cli_credentials_set_password(cmdline_credentials, "", CRED_GUESS_ENV);
+ cli_credentials_set_password(popt_get_cmdline_credentials(),
+ "", CRED_GUESS_ENV);
while (1) {
cline = smb_readline("torture> ", NULL, NULL);
@@ -226,11 +227,14 @@ static void shell_auth(const struct shell_command * command,
const char * password;
const char * principal;
- username = cli_credentials_get_username(cmdline_credentials);
- principal = cli_credentials_get_principal(cmdline_credentials, tctx);
- domain = cli_credentials_get_domain(cmdline_credentials);
- realm = cli_credentials_get_realm(cmdline_credentials);
- password = cli_credentials_get_password(cmdline_credentials);
+ username = cli_credentials_get_username(
+ popt_get_cmdline_credentials());
+ principal = cli_credentials_get_principal(
+ popt_get_cmdline_credentials(), tctx);
+ domain = cli_credentials_get_domain(popt_get_cmdline_credentials());
+ realm = cli_credentials_get_realm(popt_get_cmdline_credentials());
+ password = cli_credentials_get_password(
+ popt_get_cmdline_credentials());
printf("Username: %s\n", username ? username : "");
printf("User Principal: %s\n", principal ? principal : "");
@@ -242,19 +246,24 @@ static void shell_auth(const struct shell_command * command,
if (!strcmp(argv[0], "username")) {
result = cli_credentials_set_username(
- cmdline_credentials, argv[1], CRED_SPECIFIED);
+ popt_get_cmdline_credentials(),
+ argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "principal")) {
result = cli_credentials_set_principal(
- cmdline_credentials, argv[1], CRED_SPECIFIED);
+ popt_get_cmdline_credentials(),
+ argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "domain")) {
result = cli_credentials_set_domain(
- cmdline_credentials, argv[1], CRED_SPECIFIED);
+ popt_get_cmdline_credentials(),
+ argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "realm")) {
result = cli_credentials_set_realm(
- cmdline_credentials, argv[1], CRED_SPECIFIED);
+ popt_get_cmdline_credentials(),
+ argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "password")) {
result = cli_credentials_set_password(
- cmdline_credentials, argv[1], CRED_SPECIFIED);
+ popt_get_cmdline_credentials(),
+ argv[1], CRED_SPECIFIED);
} else {
shell_usage(command);
return;