diff options
author | Günther Deschner <gd@samba.org> | 2008-03-08 00:42:40 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-03-08 23:07:00 +0100 |
commit | 3102609c4bf18c547ad2171b313e620647a718bf (patch) | |
tree | 3f00e0f7ee87b0c342107477a298a302d69c146c /source3/rpc_server | |
parent | 62ca78bd27a015681ee22676c88d0fad4d1d7ced (diff) | |
download | samba-3102609c4bf18c547ad2171b313e620647a718bf.tar.gz samba-3102609c4bf18c547ad2171b313e620647a718bf.tar.bz2 samba-3102609c4bf18c547ad2171b313e620647a718bf.zip |
Use pidl for _srvsvc_NetSetFileSecurity.
Guenther
(This used to be commit 64a121c147c825259a06a8cd8de85ec31dd5b4a4)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_srvsvc.c | 23 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 54 |
2 files changed, 27 insertions, 50 deletions
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c index 1873bcb578..a53803c986 100644 --- a/source3/rpc_server/srv_srvsvc.c +++ b/source3/rpc_server/srv_srvsvc.c @@ -321,28 +321,7 @@ static bool api_srv_net_file_query_secdesc(pipes_struct *p) static bool api_srv_net_file_set_secdesc(pipes_struct *p) { - SRV_Q_NET_FILE_SET_SECDESC q_u; - SRV_R_NET_FILE_SET_SECDESC r_u; - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - /* Unmarshall the net file set info from Win9x */ - if(!srv_io_q_net_file_set_secdesc("", &q_u, data, 0)) { - DEBUG(0,("api_srv_net_file_set_secdesc: Failed to unmarshall SRV_Q_NET_FILE_SET_SECDESC.\n")); - return False; - } - - r_u.status = _srv_net_file_set_secdesc(p, &q_u, &r_u); - - if(!srv_io_r_net_file_set_secdesc("", &r_u, rdata, 0)) { - DEBUG(0,("api_srv_net_file_set_secdesc: Failed to marshall SRV_R_NET_FILE_SET_SECDESC.\n")); - return False; - } - - return True; + return proxy_srvsvc_call(p, NDR_SRVSVC_NETSETFILESECURITY); } /******************************************************************* diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index d45ebb26e6..276ae8e243 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -2176,11 +2176,12 @@ error_exit: } /*********************************************************************************** + _srvsvc_NetSetFileSecurity Win9x NT tools set security descriptor. ***********************************************************************************/ -WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_u, - SRV_R_NET_FILE_SET_SECDESC *r_u) +WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p, + struct srvsvc_NetSetFileSecurity *r) { char *filename_in = NULL; char *filename = NULL; @@ -2189,6 +2190,7 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ files_struct *fsp = NULL; SMB_STRUCT_STAT st; NTSTATUS nt_status; + WERROR werr; struct current_user user; connection_struct *conn = NULL; bool became_user = False; @@ -2196,11 +2198,11 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ ZERO_STRUCT(st); - r_u->status = WERR_OK; + werr = WERR_OK; - qualname = unistr2_to_ascii_talloc(ctx, &q_u->uni_qual_name); + qualname = talloc_strdup(ctx, r->in.share); if (!qualname) { - r_u->status = WERR_ACCESS_DENIED; + werr = WERR_ACCESS_DENIED; goto error_exit; } @@ -2214,35 +2216,35 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ unbecome_root(); if (conn == NULL) { - DEBUG(3,("_srv_net_file_set_secdesc: Unable to connect to %s\n", qualname)); - r_u->status = ntstatus_to_werror(nt_status); + DEBUG(3,("_srvsvc_NetSetFileSecurity: Unable to connect to %s\n", qualname)); + werr = ntstatus_to_werror(nt_status); 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 = WERR_ACCESS_DENIED; + DEBUG(0,("_srvsvc_NetSetFileSecurity: Can't become connected user!\n")); + werr = WERR_ACCESS_DENIED; goto error_exit; } became_user = True; - filename_in= unistr2_to_ascii_talloc(ctx, &q_u->uni_file_name); + filename_in = talloc_strdup(ctx, r->in.file); if (!filename_in) { - r_u->status = WERR_ACCESS_DENIED; + werr = WERR_ACCESS_DENIED; goto error_exit; } nt_status = unix_convert(ctx, conn, filename, False, &filename, NULL, &st); if (!NT_STATUS_IS_OK(nt_status)) { - DEBUG(3,("_srv_net_file_set_secdesc: bad pathname %s\n", filename)); - r_u->status = WERR_ACCESS_DENIED; + DEBUG(3,("_srvsvc_NetSetFileSecurity: bad pathname %s\n", filename)); + werr = WERR_ACCESS_DENIED; goto error_exit; } nt_status = check_name(conn, filename); if (!NT_STATUS_IS_OK(nt_status)) { - DEBUG(3,("_srv_net_file_set_secdesc: can't access %s\n", filename)); - r_u->status = WERR_ACCESS_DENIED; + DEBUG(3,("_srvsvc_NetSetFileSecurity: can't access %s\n", filename)); + werr = WERR_ACCESS_DENIED; goto error_exit; } @@ -2260,24 +2262,26 @@ WERROR _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ NULL, &fsp); if ( !NT_STATUS_IS_OK(nt_status) ) { - DEBUG(3,("_srv_net_file_set_secdesc: Unable to open file %s\n", filename)); - r_u->status = ntstatus_to_werror(nt_status); + DEBUG(3,("_srvsvc_NetSetFileSecurity: Unable to open file %s\n", filename)); + werr = ntstatus_to_werror(nt_status); goto error_exit; } } - nt_status = SMB_VFS_SET_NT_ACL(fsp, fsp->fsp_name, q_u->sec_info, q_u->sec_desc); + nt_status = SMB_VFS_SET_NT_ACL(fsp, fsp->fsp_name, + r->in.securityinformation, + r->in.sd_buf->sd); if (!NT_STATUS_IS_OK(nt_status) ) { - DEBUG(3,("_srv_net_file_set_secdesc: Unable to set NT ACL on file %s\n", filename)); - r_u->status = WERR_ACCESS_DENIED; + DEBUG(3,("_srvsvc_NetSetFileSecurity: Unable to set NT ACL on file %s\n", filename)); + werr = WERR_ACCESS_DENIED; goto error_exit; } close_file(fsp, NORMAL_CLOSE); unbecome_user(); close_cnum(conn, user.vuid); - return r_u->status; + return werr; error_exit: @@ -2293,7 +2297,7 @@ error_exit: close_cnum(conn, user.vuid); } - return r_u->status; + return werr; } /*********************************************************************************** @@ -2588,12 +2592,6 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p, struct srvsvc_NetGetFileSecur return WERR_NOT_SUPPORTED; } -WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p, struct srvsvc_NetSetFileSecurity *r) -{ - p->rng_fault_state = True; - return WERR_NOT_SUPPORTED; -} - WERROR _srvsvc_NetServerTransportAddEx(pipes_struct *p, struct srvsvc_NetServerTransportAddEx *r) { p->rng_fault_state = True; |