From 7e9d639ed1584c2f7cd3556ce3e93974851f74c6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 11 Nov 2007 12:49:42 +0100 Subject: Cosmetic fix Do directory vs file open before entering open_file_stat (This used to be commit cd62122916defbfb57468c3b82a60b766fc4652e) --- source3/smbd/file_access.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/smbd/file_access.c') 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))); -- cgit