mode);
}
+static int widelinks_openat(vfs_handle_struct *handle,
+ const struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ files_struct *fsp,
+ int flags,
+ mode_t mode)
+{
+ struct widelinks_config *config = NULL;
+
+ SMB_VFS_HANDLE_GET_DATA(handle,
+ config,
+ struct widelinks_config,
+ return -1);
+
+ if (config->active &&
+ (config->cwd != NULL) &&
+ !(smb_fname->flags & SMB_FILENAME_POSIX_PATH))
+ {
+ /*
+ * Module active, openat after chdir (see note 1b above) and not
+ * a POSIX open (POSIX sees symlinks), so remove O_NOFOLLOW.
+ */
+ flags = (flags & ~O_NOFOLLOW);
+ }
+
+ return SMB_VFS_NEXT_OPENAT(handle,
+ dirfsp,
+ smb_fname,
+ fsp,
+ flags,
+ mode);
+}
+
static struct dirent *widelinks_readdir(vfs_handle_struct *handle,
DIR *dirp,
SMB_STRUCT_STAT *sbuf)
.connect_fn = widelinks_connect,
.open_fn = widelinks_open,
+ .openat_fn = widelinks_openat,
.lstat_fn = widelinks_lstat,
/*
* NB. We don't need an lchown function as this