mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
printing: convert move_driver_to_download_area() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
76297c3c17
commit
ae32a2681a
@ -1482,11 +1482,11 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info
|
||||
const char *short_architecture;
|
||||
struct smb_filename *smb_dname = NULL;
|
||||
char *new_dir = NULL;
|
||||
struct conn_struct_tos *c = NULL;
|
||||
connection_struct *conn = NULL;
|
||||
NTSTATUS nt_status;
|
||||
int i;
|
||||
int ver = 0;
|
||||
struct smb_filename *oldcwd_fname = NULL;
|
||||
char *printdollar = NULL;
|
||||
int printdollar_snum;
|
||||
WERROR err = WERR_OK;
|
||||
@ -1525,13 +1525,11 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info
|
||||
return WERR_BAD_NET_NAME;
|
||||
}
|
||||
|
||||
nt_status = create_conn_struct_cwd(frame,
|
||||
server_event_context(),
|
||||
server_messaging_context(),
|
||||
&conn,
|
||||
printdollar_snum,
|
||||
lp_path(frame, printdollar_snum),
|
||||
session_info, &oldcwd_fname);
|
||||
nt_status = create_conn_struct_tos_cwd(server_messaging_context(),
|
||||
printdollar_snum,
|
||||
lp_path(frame, printdollar_snum),
|
||||
session_info,
|
||||
&c);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
DEBUG(0,("move_driver_to_download_area: create_conn_struct "
|
||||
"returned %s\n", nt_errstr(nt_status)));
|
||||
@ -1539,6 +1537,7 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info
|
||||
TALLOC_FREE(frame);
|
||||
return err;
|
||||
}
|
||||
conn = c->conn;
|
||||
|
||||
nt_status = set_conn_force_user_group(conn, printdollar_snum);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
@ -1694,12 +1693,6 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info
|
||||
err_exit:
|
||||
unbecome_user();
|
||||
err_free_conn:
|
||||
if (conn != NULL) {
|
||||
vfs_ChDir(conn, oldcwd_fname);
|
||||
SMB_VFS_DISCONNECT(conn);
|
||||
conn_free(conn);
|
||||
}
|
||||
|
||||
TALLOC_FREE(frame);
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user