summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-05-21 15:17:23 +0530
committerVijay Bellur <vbellur@redhat.com>2014-05-22 23:31:51 -0700
commit0127da7bb24794e737adc5a3195d3c54a175257f (patch)
tree72c9726b77a98d4ed9ff798f06e5de0bf3ce7eb7 /xlators/storage/posix
parente9a1a7135b9927fbdefd2921b38e10bdbb694b97 (diff)
storage/posix: Don't allow open on symlink
Change-Id: Ie38ecad621d5cb351c607c9676814c573834cb0b BUG: 1099858 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7823 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 72c52339e5e..825715e71ba 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -2258,6 +2258,12 @@ posix_open (call_frame_t *frame, xlator_t *this,
MAKE_INODE_HANDLE (real_path, this, loc, &stbuf);
+ if (IA_ISLNK (stbuf.ia_type)) {
+ op_ret = -1;
+ op_errno = ELOOP;
+ goto out;
+ }
+
op_ret = -1;
SET_FS_ID (frame->root->uid, frame->root->gid);
@@ -2268,8 +2274,8 @@ posix_open (call_frame_t *frame, xlator_t *this,
if (_fd == -1) {
op_ret = -1;
op_errno = errno;
- gf_log (this->name, GF_LOG_ERROR,
- "open on %s: %s", real_path, strerror (op_errno));
+ gf_log (this->name, GF_LOG_ERROR, "open on %s, flags: %d: %s",
+ real_path, flags, strerror (op_errno));
goto out;
}