Until glusterfs supports O_PATH, fallback to become_root().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
int flags,
mode_t mode)
{
+ bool became_root = false;
glfs_fd_t *glfd;
glfs_fd_t **p_tmp;
return -1;
}
+ if (fsp->fsp_flags.is_pathref) {
+ /*
+ * ceph doesn't support O_PATH so we have to fallback to
+ * become_root().
+ */
+ become_root();
+ became_root = true;
+ }
+
if (flags & O_DIRECTORY) {
glfd = glfs_opendir(handle->data, smb_fname->base_name);
} else if (flags & O_CREAT) {
glfd = glfs_open(handle->data, smb_fname->base_name, flags);
}
+ if (became_root) {
+ unbecome_root();
+ }
+
+ fsp->fsp_flags.have_proc_fds = false;
+
if (glfd == NULL) {
END_PROFILE(syscall_openat);
/* no extension destroy_fn, so no need to save errno */