The representation of paths as an aggregate involving any
number of objects argues against ever permitting such
operations.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit
297220fd2a96c0cf34701127b8cf724e24e6865f)
goto out;
}
+ /* forbid renaming of directories (unreasonable at scale) */
+ if (rgw_fh->is_dir()) {
+ ldout(get_context(), 12) << __func__
+ << " rejecting attempt to rename directory path="
+ << rgw_fh->full_object_name()
+ << dendl;
+ rgw_fh->mtx.unlock(); /* !LOCKED */
+ unref(rgw_fh); /* -ref */
+ rc = -EPERM;
+ goto out;
+ }
+
for (int ix : {0, 1}) {
switch (ix) {
case 0: