]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:ntvfs: Use cli_credentials_init_server()
authorAndreas Schneider <asn@samba.org>
Tue, 6 Apr 2021 13:21:38 +0000 (15:21 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 9 Apr 2021 10:46:28 +0000 (10:46 +0000)
This also removes cifs:domain option for the machine account case.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/ntvfs/cifs/vfs_cifs.c

index 4e11568ea464d646d4f21e42f01eea972c2fb05b..8f5ef0f5730b9fabdd13761e42e0a404901956f9 100644 (file)
@@ -228,13 +228,10 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
                cli_credentials_set_password(credentials, pass, CRED_SPECIFIED);
        } else if (machine_account) {
                DEBUG(5, ("CIFS backend: Using machine account\n"));
-               credentials = cli_credentials_init(p);
-               cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx);
-               if (domain) {
-                       cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
-               }
-               status = cli_credentials_set_machine_account(credentials, ntvfs->ctx->lp_ctx);
-               if (!NT_STATUS_IS_OK(status)) {
+               credentials = cli_credentials_init_server(p,
+                                                         ntvfs->ctx->lp_ctx);
+               if (credentials == NULL) {
+                       status = NT_STATUS_NO_MEMORY;
                        goto out;
                }
        } else if (req->session_info->credentials) {