From acfef038be1db770c33476bbb33b53558ddabc91 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 1 Aug 2019 14:43:04 +0200 Subject: Add option to rdsquashfs to dump extended attributes for an inode Signed-off-by: David Oberhollenzer --- unpack/options.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'unpack/options.c') diff --git a/unpack/options.c b/unpack/options.c index c281415..e5e0389 100644 --- a/unpack/options.c +++ b/unpack/options.c @@ -9,6 +9,7 @@ static struct option long_opts[] = { { "list", required_argument, NULL, 'l' }, { "cat", required_argument, NULL, 'c' }, + { "xattr", required_argument, NULL, 'x' }, { "unpack-root", required_argument, NULL, 'p' }, { "unpack-path", required_argument, NULL, 'u' }, { "no-dev", no_argument, NULL, 'D' }, @@ -26,7 +27,7 @@ static struct option long_opts[] = { { "version", no_argument, NULL, 'V' }, }; -static const char *short_opts = "l:c:u:p:DSFLCOEZj:dqhV"; +static const char *short_opts = "l:c:u:p:x:DSFLCOEZj:dqhV"; static const char *help_string = "Usage: %s [OPTIONS] \n" @@ -39,6 +40,8 @@ static const char *help_string = " the squashfs image.\n" " --cat, -c If the specified path is a regular file in the,\n" " image, dump its contents to stdout.\n" +" --xattr, -x Enumerate extended attributes associated with\n" +" an inode that the given path resolves to.\n" " --unpack-path, -u Unpack this sub directory from the image. To\n" " unpack everything, simply specify /.\n" " --describe, -d Produce a file listing from the image.\n" @@ -152,6 +155,11 @@ void process_command_line(options_t *opt, int argc, char **argv) free(opt->cmdpath); opt->cmdpath = NULL; break; + case 'x': + opt->op = OP_RDATTR; + opt->rdtree_flags |= RDTREE_READ_XATTR; + opt->cmdpath = get_path(opt->cmdpath, optarg); + break; case 'l': opt->op = OP_LS; opt->cmdpath = get_path(opt->cmdpath, optarg); -- cgit v1.2.3