diff options
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index 735a429102..cf65d5119f 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -1693,6 +1693,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ struct current_user user; fstring user_name; connection_struct *conn = NULL; + BOOL became_user = False; ZERO_STRUCT(st); @@ -1714,6 +1715,13 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ goto error_exit; } + if (!become_user(conn, conn->vuid)) { + DEBUG(0,("_srv_net_file_set_secdesc: Can't become connected user!\n")); + r_u->status = ERRnoaccess; + goto error_exit; + } + became_user = True; + unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename)); unix_convert(filename, conn, NULL, &bad_path, &st); @@ -1742,6 +1750,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ } close_file(fsp, True); + unbecome_user(); close_cnum(conn, user.vuid); return r_u->status; @@ -1751,6 +1760,9 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ close_file(fsp, True); } + if (became_user) + unbecome_user(); + if (conn) close_cnum(conn, user.vuid); |