AT_EMTPY_PATH does not exist on AIX. Address this by implementing an
override for fstat. Implement the new override function in nfs4_acls.c
since all stat functions with DAC_CAP_OVERRIDE will be moved there to
allow reuse by other filesystems.
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
05f1ee1ae2d8439af0ac9baf64ebba1a3374ea83)
return 0;
}
+int fstat_with_cap_dac_override(int fd, SMB_STRUCT_STAT *sbuf,
+ bool fake_dir_create_times)
+{
+ int ret;
+
+ set_effective_capability(DAC_OVERRIDE_CAPABILITY);
+ ret = sys_fstat(fd, sbuf, fake_dir_create_times);
+ drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
+
+ return ret;
+}
+
/************************************************
Split the ACE flag mapping between nfs4 and Windows
into two separate functions rather than trying to do
int smbacl4_get_vfs_params(struct connection_struct *conn,
struct smbacl4_vfs_params *params);
+int fstat_with_cap_dac_override(int fd, SMB_STRUCT_STAT *sbuf,
+ bool fake_dir_create_times);
+
struct SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx);
/* prop's contents are copied */
DBG_DEBUG("fstat for %s failed with EACCES. Trying with "
"CAP_DAC_OVERRIDE.\n", fsp->fsp_name->base_name);
- ret = fstatat_with_cap_dac_override(fsp_get_pathref_fd(fsp),
- "",
- sbuf,
- AT_EMPTY_PATH,
- fake_dctime);
+ ret = fstat_with_cap_dac_override(fsp_get_pathref_fd(fsp),
+ sbuf,
+ fake_dctime);
}
return ret;