From a6777636fbb94a34a37cadd7840429f72fc5b747 Mon Sep 17 00:00:00 2001 From: Rahul C S Date: Tue, 3 Jan 2012 22:24:22 +0530 Subject: Avoid setting dict when size is -1 when lgetxattr fails and returns size as -1, we still try to set the dict. Instead it should set proper errno & exit. Change-Id: I282dc0765e562bd9bbcf852453cd3b72d918b269 BUG: 771313 Signed-off-by: Rahul C S Reviewed-on: http://review.gluster.com/2555 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/storage/posix/src/posix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index ab512af15ac..cf5d855fede 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2564,6 +2564,11 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, strcpy (key, name); size = sys_lgetxattr (real_path, key, NULL, 0); + if (size == -1) { + op_ret = -1; + op_errno = errno; + goto out; + } value = GF_CALLOC (size + 1, sizeof(char), gf_posix_mt_char); if (!value) { op_ret = -1; -- cgit