summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-04-20 11:20:41 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-20 06:06:31 -0700
commit9083ed64125f17ff04383f32300582d7b33c0be4 (patch)
treefbf2d877d5290989dc2b04d48db5d33ac1e50863 /xlators/storage/posix
parentd10e17bf59966d66ebe4ea5627cf89b10bcd5fe8 (diff)
storage/posix: Don't allow mkdir() on HIDDEN_DIRECTORY
Change-Id: Iecbd71d13ee8a492a99689674be99b4a451593db BUG: 788150 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3200 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 168e7f7d2e6..c218a673548 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -913,6 +913,18 @@ posix_mkdir (call_frame_t *frame, xlator_t *this,
VALIDATE_OR_GOTO (this, out);
VALIDATE_OR_GOTO (loc, out);
+ /* The Hidden directory should be for housekeeping purpose and it
+ should not get created from a user request */
+ if (__is_root_gfid (loc->pargfid) &&
+ (strcmp (loc->name, GF_HIDDEN_PATH) == 0)) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "mkdir issued on %s, which is not permitted",
+ GF_HIDDEN_PATH);
+ op_errno = EPERM;
+ op_ret = -1;
+ goto out;
+ }
+
priv = this->private;
VALIDATE_OR_GOTO (priv, out);