From 4e5aef61f3105c1073a49a608d5e727379189158 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 14 Dec 2015 12:16:08 -0500 Subject: [PATCH] librgw: don't allow open on directories (externally) Signed-off-by: Matt Benjamin --- src/rgw/rgw_file.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 9f8030f109533..bd65a6bdfda7b 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -519,6 +519,8 @@ int rgw_open(struct rgw_fs *rgw_fs, * for now, we will support single-open only, it's preferable to * anything we can otherwise do without access to the NFS state */ + if (! rgw_fh->is_file()) + return -EISDIR; // convert flags uint32_t oflags = 0; -- 2.39.5