summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-02-22 05:25:11 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-22 09:21:57 -0800
commit21e4db42468d5bb7ebd9fa6a91461edd11b2a6da (patch)
tree7813dfcdbf47d14cdfff191ff3fc75fa42466953 /xlators/storage
parent2a184da3ca83f03dec69fcf0f26ae84c231d2e37 (diff)
storage/posix: set op_ret to -1 when setgid_override fails.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2409 (crash in stat prefetch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2409
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index f46e10e9a..b63300fb9 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1068,8 +1068,11 @@ posix_mknod (call_frame_t *frame, xlator_t *this,
gid = frame->root->gid;
op_ret = setgid_override (this, real_path, &gid);
- if (op_ret < 0)
+ if (op_ret < 0) {
+ op_errno = -op_ret;
+ op_ret = -1;
goto out;
+ }
SET_FS_ID (frame->root->uid, gid);
pathdup = gf_strdup (real_path);
@@ -1336,8 +1339,11 @@ posix_mkdir (call_frame_t *frame, xlator_t *this,
}
op_ret = setgid_override (this, real_path, &gid);
- if (op_ret < 0)
+ if (op_ret < 0) {
+ op_errno = -op_ret;
+ op_ret = -1;
goto out;
+ }
SET_FS_ID (frame->root->uid, gid);
pathdup = gf_strdup (real_path);
@@ -1625,8 +1631,11 @@ posix_symlink (call_frame_t *frame, xlator_t *this,
gid = frame->root->gid;
op_ret = setgid_override (this, real_path, &gid);
- if (op_ret < 0)
+ if (op_ret < 0) {
+ op_errno = -op_ret;
+ op_ret = -1;
goto out;
+ }
SET_FS_ID (frame->root->uid, gid);
pathdup = gf_strdup (real_path);
@@ -2026,8 +2035,9 @@ posix_create (call_frame_t *frame, xlator_t *this,
gid = frame->root->gid;
op_ret = setgid_override (this, real_path, &gid);
-
if (op_ret < 0) {
+ op_errno = -op_ret;
+ op_ret = -1;
goto out;
}
@@ -2172,8 +2182,11 @@ posix_open (call_frame_t *frame, xlator_t *this,
MAKE_REAL_PATH (real_path, this, loc->path);
op_ret = setgid_override (this, real_path, &gid);
- if (op_ret < 0)
+ if (op_ret < 0) {
+ op_errno = -op_ret;
+ op_ret = -1;
goto out;
+ }
SET_FS_ID (frame->root->uid, gid);