diff options
author | Andreas Schneider <asn@samba.org> | 2019-10-28 09:35:34 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2019-12-09 12:48:45 +0000 |
commit | 1b42ccfc23eaa8f5b007928bc8bb65b944359f36 (patch) | |
tree | 90a4d5e424b4142800c341a8dbf21fa5452f9146 /source3/client | |
parent | 8987d7eef4f2e1cb1ed29c3607bb6218f6cf668d (diff) | |
download | samba-1b42ccfc23eaa8f5b007928bc8bb65b944359f36.tar.gz |
s3:smbspool: Map AUTH_INFO_REQUIRED=none to anonymous connection
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/smbspool.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 36f7f67ca94..34def0c91a9 100644 --- a/source3/client/smbspool.c +++ b/source3/client/smbspool.c @@ -287,7 +287,7 @@ main(int argc, /* I - Number of command-line arguments */ auth_info_required = getenv("AUTH_INFO_REQUIRED"); if (auth_info_required == NULL) { - auth_info_required = "none"; + auth_info_required = "samba"; } /* @@ -718,7 +718,9 @@ smb_connect(struct cli_state **output_cli, fprintf(stderr, "DEBUG: Try to connect using username/password ...\n"); - } else { + } else if (strcmp(auth_info_required, "none") == 0) { + goto anonymous; + } else if (strcmp(auth_info_required, "samba") == 0) { if (username != NULL) { flags |= CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS; } else if (kerberos_ccache_is_valid()) { @@ -731,6 +733,8 @@ smb_connect(struct cli_state **output_cli, "DEBUG: This backend requires credentials!\n"); return NT_STATUS_ACCESS_DENIED; } + } else { + return NT_STATUS_ACCESS_DENIED; } nt_status = smb_complete_connection(&cli, @@ -780,6 +784,7 @@ smb_connect(struct cli_state **output_cli, * last try. Use anonymous authentication */ +anonymous: nt_status = smb_complete_connection(&cli, myname, server, |