summaryrefslogtreecommitdiff
path: root/source3/smbd/dir.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-10-13 21:06:49 +0200
committerMichael Adam <obnox@samba.org>2007-11-13 15:47:01 +0100
commit15953b82eb3b49d736b4b835b1d0d3cf0da0bff8 (patch)
tree4b3d872f0e8747386fb21fc1a893c0558aa2fc75 /source3/smbd/dir.c
parent9441d1ba87313e0ecc6e6971a25e7ad0c280fdd7 (diff)
downloadsamba-15953b82eb3b49d736b4b835b1d0d3cf0da0bff8.tar.gz
samba-15953b82eb3b49d736b4b835b1d0d3cf0da0bff8.tar.bz2
samba-15953b82eb3b49d736b4b835b1d0d3cf0da0bff8.zip
Make [f]get_nt_acl return NTSTATUS
(This used to be commit dcbe1bf942d017a3cd5084c6ef605a13912f795b)
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r--source3/smbd/dir.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index f6a8b27ab4..05679ee0ee 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -911,7 +911,6 @@ bool get_dir_entry(TALLOC_CTX *ctx,
static bool user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
{
SEC_DESC *psd = NULL;
- size_t sd_size;
files_struct *fsp;
NTSTATUS status;
uint32 access_granted;
@@ -951,12 +950,12 @@ static bool user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_S
}
/* Get NT ACL -allocated in main loop talloc context. No free needed here. */
- sd_size = SMB_VFS_FGET_NT_ACL(fsp, fsp->fh->fd,
+ status = SMB_VFS_FGET_NT_ACL(fsp, fsp->fh->fd,
(OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION), &psd);
close_file(fsp, NORMAL_CLOSE);
/* No access if SD get failed. */
- if (!sd_size) {
+ if (!NT_STATUS_IS_OK(status)) {
return False;
}
@@ -974,7 +973,6 @@ static bool user_can_read_file(connection_struct *conn, char *name, SMB_STRUCT_S
static bool user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_STAT *pst)
{
SEC_DESC *psd = NULL;
- size_t sd_size;
files_struct *fsp;
int info;
NTSTATUS status;
@@ -1014,13 +1012,14 @@ static bool user_can_write_file(connection_struct *conn, char *name, SMB_STRUCT_
}
/* Get NT ACL -allocated in main loop talloc context. No free needed here. */
- sd_size = SMB_VFS_FGET_NT_ACL(fsp, fsp->fh->fd,
+ status = SMB_VFS_FGET_NT_ACL(fsp, fsp->fh->fd,
(OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION), &psd);
close_file(fsp, NORMAL_CLOSE);
/* No access if SD get failed. */
- if (!sd_size)
+ if (!NT_STATUS_IS_OK(status)) {
return False;
+ }
return se_access_check(psd, current_user.nt_user_token, FILE_WRITE_DATA,
&access_granted, &status);