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-Tag: v20.0.0~2536^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=52ef1f1abb259dca0c33519c49aabedd926c6cb2;p=ceph.git mgr/nfs: validate path before updating a cephfs export Fixes: https://tracker.ceph.com/issues/62077 Signed-off-by: Dhairya Parmar --- diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index ed3bc1be3a44..8e6dcff7fcb5 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -686,6 +686,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}'")