aboutsummaryrefslogtreecommitdiff
path: root/unpack/rdsquashfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'unpack/rdsquashfs.c')
-rw-r--r--unpack/rdsquashfs.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/unpack/rdsquashfs.c b/unpack/rdsquashfs.c
index 4b2dc6c..5eb10f2 100644
--- a/unpack/rdsquashfs.c
+++ b/unpack/rdsquashfs.c
@@ -6,6 +6,21 @@
*/
#include "rdsquashfs.h"
+static void dump_xattrs(fstree_t *fs, tree_xattr_t *xattr)
+{
+ const char *key, *value;
+ size_t i;
+
+ for (i = 0; i < xattr->num_attr; ++i) {
+ key = str_table_get_string(&fs->xattr_keys,
+ xattr->attr[i].key_index);
+ value = str_table_get_string(&fs->xattr_values,
+ xattr->attr[i].value_index);
+
+ printf("%s=%s\n", key, value);
+ }
+}
+
int main(int argc, char **argv)
{
int status = EXIT_FAILURE;
@@ -106,6 +121,10 @@ int main(int argc, char **argv)
case OP_DESCRIBE:
describe_tree(fs.root, opt.unpack_root);
break;
+ case OP_RDATTR:
+ if (n->xattr != NULL)
+ dump_xattrs(&fs, n->xattr);
+ break;
}
status = EXIT_SUCCESS;