Currently identical to SMB_VFS_GET_NT_ACL().
Next, add to all VFS modules that implement
get_nt_acl and eventually remove get_nt_acl.
NB. Modules that use smb_vfs_assert_all_fns()
have SMB_VFS_GET_NT_ACL_AT() will not build
until they have this function added.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
return NT_STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS skel_get_nt_acl_at(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc)
+{
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
uint32_t security_info_sent,
const struct security_descriptor *psd)
.fget_nt_acl_fn = skel_fget_nt_acl,
.get_nt_acl_fn = skel_get_nt_acl,
+ .get_nt_acl_at_fn = skel_get_nt_acl_at,
.fset_nt_acl_fn = skel_fset_nt_acl,
/* POSIX ACL operations. */
ppdesc);
}
+static NTSTATUS skel_get_nt_acl_at(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc)
+{
+ return SMB_VFS_NEXT_GET_NT_ACL_AT(handle,
+ dirfsp,
+ smb_fname,
+ security_info,
+ mem_ctx,
+ ppdesc);
+}
+
static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
uint32_t security_info_sent,
const struct security_descriptor *psd)
.fget_nt_acl_fn = skel_fget_nt_acl,
.get_nt_acl_fn = skel_get_nt_acl,
+ .get_nt_acl_at_fn = skel_get_nt_acl_at,
.fset_nt_acl_fn = skel_fset_nt_acl,
/* POSIX ACL operations. */
\
SMBPROFILE_STATS_SECTION_START(acl, "ACL Calls") \
SMBPROFILE_STATS_BASIC(get_nt_acl) \
+ SMBPROFILE_STATS_BASIC(get_nt_acl_at) \
SMBPROFILE_STATS_BASIC(fget_nt_acl) \
SMBPROFILE_STATS_BASIC(fset_nt_acl) \
SMBPROFILE_STATS_SECTION_END \
* to be a struct smb_filename
* Version 43 - convert link_contents arg of SMB_VFS_SYMLINKAT()
* to struct smb_filename
+ * Version 43 - Add SMB_VFS_GET_NT_ACL_AT().
*/
#define SMB_VFS_INTERFACE_VERSION 43
uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc);
+ NTSTATUS (*get_nt_acl_at_fn)(struct vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc);
NTSTATUS (*fset_nt_acl_fn)(struct vfs_handle_struct *handle,
struct files_struct *fsp,
uint32_t security_info_sent,
uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc);
+NTSTATUS smb_vfs_call_get_nt_acl_at(struct vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc);
NTSTATUS smb_vfs_call_fset_nt_acl(struct vfs_handle_struct *handle,
struct files_struct *fsp,
uint32_t security_info_sent,
uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc);
+NTSTATUS vfs_not_implemented_get_nt_acl_at(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc);
NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
uint32_t security_info_sent,
const struct security_descriptor *psd);
#define SMB_VFS_NEXT_GET_NT_ACL(handle, smb_fname, security_info, mem_ctx, ppdesc) \
smb_vfs_call_get_nt_acl((handle)->next, (smb_fname), (security_info), (mem_ctx), (ppdesc))
+#define SMB_VFS_GET_NT_ACL_AT(conn, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \
+ smb_vfs_call_get_nt_acl_at((conn)->vfs_handles, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc))
+#define SMB_VFS_NEXT_GET_NT_ACL_AT(handle, dirfsp, smb_fname, security_info, mem_ctx, ppdesc) \
+ smb_vfs_call_get_nt_acl_at((handle)->next, (dirfsp), (smb_fname), (security_info), (mem_ctx), (ppdesc))
+
#define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \
smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied))
#define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \
return result;
}
+static NTSTATUS vfswrap_get_nt_acl_at(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc)
+{
+ NTSTATUS result;
+
+ START_PROFILE(get_nt_acl_at);
+
+ SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+ result = posix_get_nt_acl(handle->conn,
+ smb_fname,
+ security_info,
+ mem_ctx,
+ ppdesc);
+ END_PROFILE(get_nt_acl_at);
+ return result;
+}
+
static NTSTATUS vfswrap_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd)
{
NTSTATUS result;
.fget_nt_acl_fn = vfswrap_fget_nt_acl,
.get_nt_acl_fn = vfswrap_get_nt_acl,
+ .get_nt_acl_at_fn = vfswrap_get_nt_acl_at,
.fset_nt_acl_fn = vfswrap_fset_nt_acl,
.audit_file_fn = vfswrap_audit_file,
return NT_STATUS_NOT_IMPLEMENTED;
}
+NTSTATUS vfs_not_implemented_get_nt_acl_at(vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc)
+{
+ return NT_STATUS_NOT_IMPLEMENTED;
+}
+
NTSTATUS vfs_not_implemented_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
uint32_t security_info_sent,
const struct security_descriptor *psd)
.fget_nt_acl_fn = vfs_not_implemented_fget_nt_acl,
.get_nt_acl_fn = vfs_not_implemented_get_nt_acl,
+ .get_nt_acl_at_fn = vfs_not_implemented_get_nt_acl_at,
.fset_nt_acl_fn = vfs_not_implemented_fset_nt_acl,
/* POSIX ACL operations. */
ppdesc);
}
+NTSTATUS smb_vfs_call_get_nt_acl_at(struct vfs_handle_struct *handle,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ uint32_t security_info,
+ TALLOC_CTX *mem_ctx,
+ struct security_descriptor **ppdesc)
+{
+ VFS_FIND(get_nt_acl_at);
+ return handle->fns->get_nt_acl_at_fn(handle,
+ dirfsp,
+ smb_fname,
+ security_info,
+ mem_ctx,
+ ppdesc);
+}
+
NTSTATUS smb_vfs_call_fset_nt_acl(struct vfs_handle_struct *handle,
struct files_struct *fsp,
uint32_t security_info_sent,