From 8ab992524abf765f4cf18286d98e2ccd7bcae6af Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 13 Nov 2007 23:26:38 +0100 Subject: Fix potential orphaned open files. Calling can_access_file could lead to orphaned open files when SMB_VFS_GET_NT_ACL returned ENOSYS (not implemented). Michael (This used to be commit f4f700cf0c1657c36e801fab20fe7b1a4efcb714) --- source3/smbd/file_access.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/smbd/file_access.c') diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c index 46472665e5..a58bcdd891 100644 --- a/source3/smbd/file_access.c +++ b/source3/smbd/file_access.c @@ -76,12 +76,14 @@ static NTSTATUS conn_get_nt_acl(TALLOC_CTX *mem_ctx, &secdesc); if (!NT_STATUS_IS_OK(status)) { DEBUG(5, ("Unable to get NT ACL for file %s\n", fname)); - return status; + goto done; } *psd = talloc_move(mem_ctx, &secdesc); + +done: close_file(fsp, NORMAL_CLOSE); - return NT_STATUS_OK; + return status; } static bool can_access_file_acl(struct connection_struct *conn, -- cgit