summaryrefslogtreecommitdiff
path: root/source3/smbd/file_access.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-11-11 12:49:42 +0100
committerMichael Adam <obnox@samba.org>2007-11-11 23:45:02 +0100
commit7e9d639ed1584c2f7cd3556ce3e93974851f74c6 (patch)
tree79a37827668a08bbdb800382d46eca71543d80fe /source3/smbd/file_access.c
parenta084eae03989957ad2cc4a9705697ca6c422b25c (diff)
downloadsamba-7e9d639ed1584c2f7cd3556ce3e93974851f74c6.tar.gz
samba-7e9d639ed1584c2f7cd3556ce3e93974851f74c6.tar.bz2
samba-7e9d639ed1584c2f7cd3556ce3e93974851f74c6.zip
Cosmetic fix
Do directory vs file open before entering open_file_stat (This used to be commit cd62122916defbfb57468c3b82a60b766fc4652e)
Diffstat (limited to 'source3/smbd/file_access.c')
-rw-r--r--source3/smbd/file_access.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index 189fcbbce1..121e7f79a9 100644
--- a/source3/smbd/file_access.c
+++ b/source3/smbd/file_access.c
@@ -51,9 +51,7 @@ static NTSTATUS conn_get_nt_acl(TALLOC_CTX *mem_ctx,
/* fake a files_struct ptr: */
- status = open_file_stat(conn, NULL, fname, psbuf, &fsp);
- /* Perhaps it is a directory */
- if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_IS_A_DIRECTORY)) {
+ if (S_ISDIR(psbuf->st_mode)) {
status = open_directory(conn, NULL, fname, psbuf,
READ_CONTROL_ACCESS,
FILE_SHARE_READ|FILE_SHARE_WRITE,
@@ -62,6 +60,10 @@ static NTSTATUS conn_get_nt_acl(TALLOC_CTX *mem_ctx,
FILE_ATTRIBUTE_DIRECTORY,
NULL, &fsp);
}
+ else {
+ status = open_file_stat(conn, NULL, fname, psbuf, &fsp);
+ }
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Unable to open file %s: %s\n", fname,
nt_errstr(status)));