struct path path;
int rc = 0, len;
int fs_infoclass_size = 0;
+ int lookup_flags = 0;
- rc = ksmbd_vfs_kern_path(share->path, LOOKUP_FOLLOW, &path, 0);
+ if (test_share_config_flag(share, KSMBD_SHARE_FLAG_FOLLOW_SYMLINKS))
+ lookup_flags = LOOKUP_FOLLOW;
+
+ rc = ksmbd_vfs_kern_path(share->path, lookup_flags, &path, 0);
if (rc) {
ksmbd_err("cannot create vfs path\n");
return -EIO;
struct path path;
struct dentry *dentry, *parent;
int err;
+ int flags = 0;
if (ksmbd_override_fsids(work))
return -ENOMEM;
- err = kern_path(name, LOOKUP_FOLLOW, &path);
+ if (test_share_config_flag(work->tcon->share_conf,
+ KSMBD_SHARE_FLAG_FOLLOW_SYMLINKS))
+ flags = LOOKUP_FOLLOW;
+
+ err = kern_path(name, flags, &path);
if (err) {
ksmbd_debug(VFS, "can't get %s, err %d\n", name, err);
ksmbd_revert_fsids(work);
struct path oldpath, newpath;
struct dentry *dentry;
int err;
+ int flags = 0;
if (ksmbd_override_fsids(work))
return -ENOMEM;
- err = kern_path(oldname, LOOKUP_FOLLOW, &oldpath);
+ if (test_share_config_flag(work->tcon->share_conf,
+ KSMBD_SHARE_FLAG_FOLLOW_SYMLINKS))
+ flags = LOOKUP_FOLLOW;
+
+ err = kern_path(oldname, flags, &oldpath);
if (err) {
ksmbd_err("cannot get linux path for %s, err = %d\n",
oldname, err);
}
dentry = kern_path_create(AT_FDCWD, newname, &newpath,
- LOOKUP_FOLLOW | LOOKUP_REVAL);
+ flags | LOOKUP_REVAL);
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
ksmbd_err("path create err for %s, err %d\n", newname, err);
struct dentry *src_dent, *trap_dent, *src_child;
char *dst_name;
int err;
+ int flags;
dst_name = extract_last_component(newname);
if (!dst_name)
src_dent_parent = dget_parent(fp->filp->f_path.dentry);
src_dent = fp->filp->f_path.dentry;
- err = kern_path(newname, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &dst_path);
+ flags = LOOKUP_DIRECTORY;
+ if (test_share_config_flag(work->tcon->share_conf,
+ KSMBD_SHARE_FLAG_FOLLOW_SYMLINKS))
+ flags |= LOOKUP_FOLLOW;
+
+ err = kern_path(newname, flags, &dst_path);
if (err) {
ksmbd_debug(VFS, "Cannot get path for %s [%d]\n", newname, err);
goto out;