diff options
author | Andrew Morton <akpm@digeo.com> | 2003-02-14 20:23:02 -0800 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2003-02-14 20:23:02 -0800 |
commit | af8e38c781986180d4d751106c969e846772c487 (patch) | |
tree | b93d05208d6f3288e14b4ea998fd30c38751c2e1 /fs/ext2/xattr.c | |
parent | 358bae5b0ef73e168aab2f07daf5c4f06d8f3f30 (diff) | |
download | history-af8e38c781986180d4d751106c969e846772c487.tar.gz |
[PATCH] xattr: listxattr fix
Patch from Andreas Gruenbacher <agruen@suse.de>
This patch fixes a bug in the ext2 and ext3 listxattr operation: Even if
an attribute is hidden from the user, the terminating NULL character was
included in the listxattr result. After the patch this doesn't happen
anymore.
Diffstat (limited to 'fs/ext2/xattr.c')
-rw-r--r-- | fs/ext2/xattr.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 6edc79353c67d9..8d3bf68767104e 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -409,10 +409,9 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list", goto bad_block; handler = ext2_xattr_handler(entry->e_name_index); - if (handler) { + if (handler) size += handler->list(NULL, inode, entry->e_name, - entry->e_name_len) + 1; - } + entry->e_name_len); } if (ext2_xattr_cache_insert(bh)) @@ -433,11 +432,9 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list", struct ext2_xattr_handler *handler; handler = ext2_xattr_handler(entry->e_name_index); - if (handler) { + if (handler) buf += handler->list(buf, inode, entry->e_name, entry->e_name_len); - *buf++ = '\0'; - } } error = size; |