From 409f1bc09fd8a864b950265ce80eaa32b17a7de7 Mon Sep 17 00:00:00 2001 From: MickaelK Date: Sat, 6 Jan 2024 17:17:46 +1100 Subject: [PATCH] feature (chroot): add chroot option to nfs backends --- server/plugin/plg_backend_nfs/index.go | 8 +++++++- server/plugin/plg_backend_nfs4/index.go | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/server/plugin/plg_backend_nfs/index.go b/server/plugin/plg_backend_nfs/index.go index aa3c89b3..700cdbbe 100644 --- a/server/plugin/plg_backend_nfs/index.go +++ b/server/plugin/plg_backend_nfs/index.go @@ -83,7 +83,7 @@ func (this NfsShare) LoginForm() Form { Name: "advanced", Type: "enable", Placeholder: "Advanced", - Target: []string{"nfs_uid", "nfs_gid", "nfs_machinename"}, + Target: []string{"nfs_uid", "nfs_gid", "nfs_machinename", "nfs_chroot"}, }, FormElement{ Id: "nfs_uid", @@ -103,6 +103,12 @@ func (this NfsShare) LoginForm() Form { Type: "text", Placeholder: "machine name", }, + FormElement{ + Id: "nfs_chroot", + Name: "path", + Type: "text", + Placeholder: "chroot", + }, }, } } diff --git a/server/plugin/plg_backend_nfs4/index.go b/server/plugin/plg_backend_nfs4/index.go index a099fda5..a634ef22 100644 --- a/server/plugin/plg_backend_nfs4/index.go +++ b/server/plugin/plg_backend_nfs4/index.go @@ -77,7 +77,7 @@ func (this Nfs4Share) LoginForm() Form { Name: "advanced", Type: "enable", Placeholder: "Advanced", - Target: []string{"nfs_uid", "nfs_gid", "nfs_machinename"}, + Target: []string{"nfs_uid", "nfs_gid", "nfs_machinename", "nfs_chroot"}, }, FormElement{ Id: "nfs_uid", @@ -97,6 +97,12 @@ func (this Nfs4Share) LoginForm() Form { Type: "text", Placeholder: "machine name", }, + FormElement{ + Id: "nfs_chroot", + Name: "path", + Type: "text", + Placeholder: "chroot", + }, }, } }