diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-21 20:54:22 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-21 20:55:32 +0200 |
commit | 0a1738c877e5098030932cbf54768415fe25a7c1 (patch) | |
tree | 7125fae9f34b55656a7fd4eb084d5697fc319ec7 | |
parent | 6d3ff186da6f59d2164662ca5f1052219f1d92fd (diff) |
Fix "no attributes" sentinel value for xattr reader
An inode can be of extended type for reasons other than having extended
attributes and simply set the xattr ID to 0xFFFFFFFF to indicate that
it doesn't have extended attributes.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | lib/sqfs/xattr_reader.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqfs/xattr_reader.c b/lib/sqfs/xattr_reader.c index 8859db8..99bd389 100644 --- a/lib/sqfs/xattr_reader.c +++ b/lib/sqfs/xattr_reader.c @@ -90,7 +90,8 @@ static int get_xattr_desc(xattr_reader_t *xr, uint32_t idx, size_t block, offset; if (idx >= xr->num_ids) { - fputs("Tried to access out of bounds xattr index\n", stderr); + fprintf(stderr, "Tried to access out of bounds " + "xattr index: 0x%08X\n", idx); return -1; } @@ -287,6 +288,9 @@ int xattr_reader_restore_node(xattr_reader_t *xr, fstree_t *fs, if (xr->kvrd == NULL || xr->idrd == NULL) return 0; + if (xattr == 0xFFFFFFFF) + return 0; + for (it = fs->xattr; it != NULL; it = it->next) { if (it->index == xattr) { node->xattr = it; |