summaryrefslogtreecommitdiff
path: root/source3/smbd/posix_acls.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-21 13:57:56 -0700
committerTim Prouty <tprouty@samba.org>2009-07-22 09:51:17 -0700
commit4b42927ec31a0819b1e5ec415fd1a16061cff677 (patch)
tree7ecbd49439248ef8a91855761e8d053c1a7463de /source3/smbd/posix_acls.c
parent84eced142551a1986ba727d4c57aed1296ac87b4 (diff)
downloadsamba-4b42927ec31a0819b1e5ec415fd1a16061cff677.tar.gz
samba-4b42927ec31a0819b1e5ec415fd1a16061cff677.tar.bz2
samba-4b42927ec31a0819b1e5ec415fd1a16061cff677.zip
s3: Convert some callers of vfs_stat_smb_fname to SMB_VFS_STAT()
Diffstat (limited to 'source3/smbd/posix_acls.c')
-rw-r--r--source3/smbd/posix_acls.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index fb2cda40ce..0a3b0dff75 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3372,33 +3372,45 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
uint32_t security_info, SEC_DESC **ppdesc)
{
- SMB_STRUCT_STAT sbuf;
SMB_ACL_T posix_acl = NULL;
SMB_ACL_T def_acl = NULL;
struct pai_val *pal;
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
*ppdesc = NULL;
DEBUG(10,("posix_get_nt_acl: called for file %s\n", name ));
+ status = create_synthetic_smb_fname(talloc_tos(), name, NULL, NULL,
+ &smb_fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
/* Get the stat struct for the owner info. */
- if(vfs_stat_smb_fname(conn, name, &sbuf) != 0) {
- return map_nt_error_from_unix(errno);
+ if(SMB_VFS_STAT(conn, smb_fname) != 0) {
+ status = map_nt_error_from_unix(errno);
+ goto out;
}
/* Get the ACL from the path. */
posix_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, name, SMB_ACL_TYPE_ACCESS);
/* If it's a directory get the default POSIX ACL. */
- if(S_ISDIR(sbuf.st_ex_mode)) {
+ if(S_ISDIR(smb_fname->st.st_ex_mode)) {
def_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, name, SMB_ACL_TYPE_DEFAULT);
def_acl = free_empty_sys_acl(conn, def_acl);
}
pal = load_inherited_info(conn, name);
- return posix_get_nt_acl_common(conn, name, &sbuf, pal, posix_acl,
- def_acl, security_info, ppdesc);
+ status = posix_get_nt_acl_common(conn, name, &smb_fname->st, pal,
+ posix_acl, def_acl, security_info,
+ ppdesc);
+ out:
+ TALLOC_FREE(smb_fname);
+ return status;
}
/****************************************************************************