diff options
author | Stefan Metzmacher <metze@samba.org> | 2016-11-04 12:53:43 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-01-27 08:09:15 +0100 |
commit | 022fb7ea149745fdc85bc7c6bf000b4541be9705 (patch) | |
tree | d879af0e0669f88bc583664d5ed89f5efae969f9 /source3 | |
parent | 9d60ad53b809281a5a6f6ad82a0daea99c989f2d (diff) | |
download | samba-022fb7ea149745fdc85bc7c6bf000b4541be9705.tar.gz |
s3:client: don't use cli->use_kerberos && cli->got_kerberos_mechanism in smbspool.c
We already know if we want to use kerberos and there's no point
in altering the error message if we tried but failed to use kerberos.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/smbspool.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 10e89c7bf21..49241c73bf1 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -58,7 +58,7 @@ * Local functions... */ -static int get_exit_code(struct cli_state * cli, NTSTATUS nt_status); +static int get_exit_code(struct cli_state * cli, NTSTATUS nt_status, bool use_kerberos); static void list_devices(void); static struct cli_state *smb_complete_connection(const char *, const char *, int, const char *, const char *, const char *, const char *, int, bool *need_auth); @@ -328,7 +328,8 @@ done: static int get_exit_code(struct cli_state * cli, - NTSTATUS nt_status) + NTSTATUS nt_status, + bool use_kerberos) { int i; @@ -355,7 +356,7 @@ get_exit_code(struct cli_state * cli, } if (cli) { - if (cli->use_kerberos && cli->got_kerberos_mechanism) + if (use_kerberos) fputs("ATTR: auth-info-required=negotiate\n", stderr); else fputs("ATTR: auth-info-required=username,password\n", stderr); @@ -449,7 +450,7 @@ smb_complete_connection(const char *myname, if (!NT_STATUS_IS_OK(nt_status)) { fprintf(stderr, "ERROR: Session setup failed: %s\n", nt_errstr(nt_status)); - if (get_exit_code(cli, nt_status) == 2) { + if (get_exit_code(cli, nt_status, use_kerberos) == 2) { *need_auth = true; } @@ -463,7 +464,7 @@ smb_complete_connection(const char *myname, fprintf(stderr, "ERROR: Tree connect failed (%s)\n", nt_errstr(nt_status)); - if (get_exit_code(cli, nt_status) == 2) { + if (get_exit_code(cli, nt_status, use_kerberos) == 2) { *need_auth = true; } @@ -601,7 +602,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ if (!NT_STATUS_IS_OK(nt_status)) { fprintf(stderr, "ERROR: %s opening remote spool %s\n", nt_errstr(nt_status), title); - return get_exit_code(cli, nt_status); + return get_exit_code(cli, nt_status, false); } /* @@ -619,7 +620,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ status = cli_writeall(cli, fnum, 0, (uint8_t *)buffer, tbytes, nbytes, NULL); if (!NT_STATUS_IS_OK(status)) { - int ret = get_exit_code(cli, status); + int ret = get_exit_code(cli, status, false); fprintf(stderr, "ERROR: Error writing spool: %s\n", nt_errstr(status)); fprintf(stderr, "DEBUG: Returning status %d...\n", @@ -635,7 +636,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */ if (!NT_STATUS_IS_OK(nt_status)) { fprintf(stderr, "ERROR: %s closing remote spool %s\n", nt_errstr(nt_status), title); - return get_exit_code(cli, nt_status); + return get_exit_code(cli, nt_status, false); } else { return (0); } |