summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-06-19 18:43:17 +0000
committerJeremy Allison <jra@samba.org>2001-06-19 18:43:17 +0000
commitd2846a3ea93984ab091b6a70bf127e9f7eab1c58 (patch)
treec25c89a93fe7177f91fa7ddd328e49bfacea3eed
parent850a0e27e19ac21bc66d3d26875d3f9bafd5245c (diff)
downloadsamba-d2846a3ea93984ab091b6a70bf127e9f7eab1c58.tar.gz
samba-d2846a3ea93984ab091b6a70bf127e9f7eab1c58.tar.bz2
samba-d2846a3ea93984ab091b6a70bf127e9f7eab1c58.zip
Only try and open a directory if we get EISDIR.
Jeremy. (This used to be commit 5b1245f80357f585ef3b24704e5ef34ef71e232f)
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index e56e63490d..4650512218 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1612,8 +1612,10 @@ uint32 _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC
if (!fsp) {
/* Perhaps it is a directory */
- fsp = open_directory(conn, filename, &st,
- (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, &action);
+ if (errno == EISDIR)
+ 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;
@@ -1705,8 +1707,10 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
if (!fsp) {
/* Perhaps it is a directory */
- fsp = open_directory(conn, filename, &st,
- (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), 0, &action);
+ if (errno == EISDIR)
+ 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;