All stat DAC_CAP_OVERRIDE code is being moved to nfs4_acls.c to allow
reuse by other filesystem modules.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15507
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
(cherry picked from commit
316c96ea83a7b70d35879e4743193bb1e9cb566c)
return 0;
}
+int fstatat_with_cap_dac_override(int fd,
+ const char *pathname,
+ SMB_STRUCT_STAT *sbuf,
+ int flags,
+ bool fake_dir_create_times)
+{
+ int ret;
+
+ set_effective_capability(DAC_OVERRIDE_CAPABILITY);
+ ret = sys_fstatat(fd,
+ pathname,
+ sbuf,
+ flags,
+ fake_dir_create_times);
+ drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
+
+ return ret;
+}
+
int fstat_with_cap_dac_override(int fd, SMB_STRUCT_STAT *sbuf,
bool fake_dir_create_times)
{
int smbacl4_get_vfs_params(struct connection_struct *conn,
struct smbacl4_vfs_params *params);
+int fstatat_with_cap_dac_override(int fd,
+ const char *pathname,
+ SMB_STRUCT_STAT *sbuf,
+ int flags,
+ bool fake_dir_create_times);
+
int fstat_with_cap_dac_override(int fd, SMB_STRUCT_STAT *sbuf,
bool fake_dir_create_times);
return NT_STATUS_OK;
}
-static int fstatat_with_cap_dac_override(int fd,
- const char *pathname,
- SMB_STRUCT_STAT *sbuf,
- int flags,
- bool fake_dir_create_times)
-{
- int ret;
-
- set_effective_capability(DAC_OVERRIDE_CAPABILITY);
- ret = sys_fstatat(fd,
- pathname,
- sbuf,
- flags,
- fake_dir_create_times);
- drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
-
- return ret;
-}
-
static int stat_with_capability(struct vfs_handle_struct *handle,
struct smb_filename *smb_fname, int flag)
{