]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbspool: Map AUTH_INFO_REQUIRED=none to anonymous connection
authorAndreas Schneider <asn@samba.org>
Mon, 28 Oct 2019 08:35:34 +0000 (09:35 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 9 Dec 2019 12:48:45 +0000 (12:48 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/client/smbspool.c

index 36f7f67ca94ade6d822b85210ece0eb0e70b8f44..34def0c91a908a784e4fcb41b60fcf98c833e189 100644 (file)
@@ -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,