summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-11-13 23:26:38 +0100
committerMichael Adam <obnox@samba.org>2007-11-13 23:26:38 +0100
commit8ab992524abf765f4cf18286d98e2ccd7bcae6af (patch)
treeb8a7823145ace6d6afd76773ba68a158a4bae6c2 /source3/smbd
parent052efa9a33d7a9a3b9ae9b038f6b3943c85c4bfc (diff)
downloadsamba-8ab992524abf765f4cf18286d98e2ccd7bcae6af.tar.gz
samba-8ab992524abf765f4cf18286d98e2ccd7bcae6af.tar.bz2
samba-8ab992524abf765f4cf18286d98e2ccd7bcae6af.zip
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)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/file_access.c6
1 files changed, 4 insertions, 2 deletions
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,