From a813ca26e87a68bf1766ec31ac6cb89e363590ca Mon Sep 17 00:00:00 2001 From: christoph Date: Fri, 15 Oct 2021 13:47:45 +0200 Subject: [PATCH] fixes bug #14866 vfs_ceph: ceph mount failed with (1) Operation not permitted for ceph user restricted to cephfs subpath --- source3/modules/vfs_ceph.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 4e1fa6a2df4..edc06e81cdd 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -90,6 +90,7 @@ static int cephwrap_connect(struct vfs_handle_struct *handle, const char *servi int snum = SNUM(handle->conn); const char *conf_file; const char *user_id; + const char *ceph_path = NULL; if (cmount) { handle->data = cmount; /* We have been here before */ @@ -100,6 +101,7 @@ static int cephwrap_connect(struct vfs_handle_struct *handle, const char *servi /* if config_file and/or user_id are NULL, ceph will use defaults */ conf_file = lp_parm_const_string(snum, "ceph", "config_file", NULL); user_id = lp_parm_const_string(snum, "ceph", "user_id", NULL); + ceph_path = lp_parm_const_string(snum, "ceph", "server_path", NULL); DBG_DEBUG("[CEPH] calling: ceph_create\n"); ret = ceph_create(&cmount, user_id); @@ -131,8 +133,10 @@ static int cephwrap_connect(struct vfs_handle_struct *handle, const char *servi goto err_cm_release; } + DBG_DEBUG("[CEPH] using ceph_path=%s as cephfs root directory\n", ceph_path); + DBG_DEBUG("[CEPH] calling: ceph_mount\n"); - ret = ceph_mount(cmount, NULL); + ret = ceph_mount(cmount, ceph_path); if (ret < 0) { goto err_cm_release; } -- 2.28.0.windows.1