diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index 7ae95a5eac..b28a0c9683 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -1611,9 +1611,14 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, 0, &access_mode, &action); if (!fsp) { - DEBUG(3,("_srv_net_file_query_secdesc: Unable to open file %s\n", filename)); - r_u->status = ERROR_ACCESS_DENIED; - goto error_exit; + /* Perhaps it is a directory */ + fsp = open_directory(conn, filename, &st, + (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, &action); + if (!fsp) { + DEBUG(3,("_srv_net_file_query_secdesc: Unable to open file %s\n", filename)); + r_u->status = ERROR_ACCESS_DENIED; + goto error_exit; + } } sd_size = conn->vfs_ops.get_nt_acl(fsp, fsp->fsp_name, &psd); @@ -1699,9 +1704,14 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_ (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, 0, &access_mode, &action); if (!fsp) { - DEBUG(3,("_srv_net_file_set_secdesc: Unable to open file %s\n", filename)); - r_u->status = ERROR_ACCESS_DENIED; - goto error_exit; + /* Perhaps it is a directory */ + fsp = open_directory(conn, filename, &st, + (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, &action); + if (!fsp) { + DEBUG(3,("_srv_net_file_set_secdesc: Unable to open file %s\n", filename)); + r_u->status = ERROR_ACCESS_DENIED; + goto error_exit; + } } ret = conn->vfs_ops.set_nt_acl(fsp, fsp->fsp_name, q_u->sec_info, q_u->sec_desc); |