s3:rpc_server/srvsvc: _srvsvc_NetSetFileSecurity form_junctions() to use create_conn_...
authorStefan Metzmacher <metze@samba.org>
Thu, 24 May 2018 15:55:02 +0000 (17:55 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jun 2018 18:52:22 +0000 (20:52 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/srvsvc/srv_srvsvc_nt.c

index e11471e345ac4406033b57717b535a8ec05bb9f7..e1963a40a0ced67bf95dbde54024223bed5a629f 100644 (file)
@@ -2452,9 +2452,9 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
        SMB_STRUCT_STAT st;
        NTSTATUS nt_status;
        WERROR werr;
+       struct conn_struct_tos *c = NULL;
        connection_struct *conn = NULL;
        int snum;
-       struct smb_filename *oldcwd_fname = NULL;
        struct security_descriptor *psd = NULL;
        uint32_t security_info_sent = 0;
        uint32_t ucf_flags = 0;
@@ -2478,18 +2478,18 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
                goto error_exit;
        }
 
-       nt_status = create_conn_struct_cwd(frame,
-                                          server_event_context(),
-                                          server_messaging_context(),
-                                          &conn,
-                                          snum, lp_path(frame, snum),
-                                          p->session_info, &oldcwd_fname);
+       nt_status = create_conn_struct_tos_cwd(server_messaging_context(),
+                                              snum,
+                                              lp_path(frame, snum),
+                                              p->session_info,
+                                              &c);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(10, ("create_conn_struct failed: %s\n",
                           nt_errstr(nt_status)));
                werr = ntstatus_to_werror(nt_status);
                goto error_exit;
        }
+       conn = c->conn;
 
        nt_status = filename_convert(frame,
                                        conn,
@@ -2549,15 +2549,6 @@ error_exit:
                close_file(NULL, fsp, NORMAL_CLOSE);
        }
 
-       if (oldcwd_fname) {
-               vfs_ChDir(conn, oldcwd_fname);
-       }
-
-       if (conn) {
-               SMB_VFS_DISCONNECT(conn);
-               conn_free(conn);
-       }
-
        TALLOC_FREE(frame);
        return werr;
 }