From: Dhairya Parmar Date: Mon, 7 Aug 2023 11:13:13 +0000 (+0530) Subject: mgr/nfs: validate path before updating a cephfs export X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7b328bd9d65fb4b1a5f47b32f66ee70ef5f7f889;p=ceph.git mgr/nfs: validate path before updating a cephfs export Fixes: https://tracker.ceph.com/issues/62077 Signed-off-by: Dhairya Parmar (cherry picked from commit 52ef1f1abb259dca0c33519c49aabedd926c6cb2) --- diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 0d0a189b9163..7ed988174015 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -665,6 +665,8 @@ class ExportMgr: if not check_fs(self.mgr, fs_name): raise FSNotFound(fs_name) + validate_cephfs_path(self.mgr, fs_name, path) + user_id = f"nfs.{cluster_id}.{ex_id}" if "user_id" in fsal and fsal["user_id"] != user_id: raise NFSInvalidOperation(f"export FSAL user_id must be '{user_id}'")