>From 820628a6d06c715273ae221c926e1c1e7d7e8385 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 18 Mar 2011 17:47:27 +0100 Subject: [PATCH] s3: Attempt to fix bug 8016 -- gpfs_get_xattr broken --- source3/modules/vfs_gpfs.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 262d167..0c28408 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -958,6 +958,7 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle, const char *pat unsigned int dosmode = 0; struct gpfs_winattr attrs; int ret = 0; + ssize_t result; DEBUG(10, ("gpfs_get_xattr: %s \n",path)); @@ -994,9 +995,11 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle, const char *pat dosmode |= FILE_ATTRIBUTE_READONLY; } - snprintf(attrstr, size, "0x%x", dosmode & SAMBA_ATTRIBUTES_MASK); + result = snprintf(attrstr, size, "0x%x", + dosmode & SAMBA_ATTRIBUTES_MASK) + 1; + DEBUG(10, ("gpfs_get_xattr: returning %s\n",attrstr)); - return size; + return result; } static int vfs_gpfs_stat(struct vfs_handle_struct *handle, -- 1.7.0.4