summaryrefslogtreecommitdiff
path: root/unpack/options.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-01 14:43:04 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-01 15:48:42 +0200
commitacfef038be1db770c33476bbb33b53558ddabc91 (patch)
tree3a681779e25f180f67d4244c3f0972b796526045 /unpack/options.c
parentb6f8bbbd4d3c344c220f884ad5629ab3576e9105 (diff)
Add option to rdsquashfs to dump extended attributes for an inode
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/options.c')
-rw-r--r--unpack/options.c10
1 files changed, 9 insertions, 1 deletions
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] <squashfs-file>\n"
@@ -39,6 +40,8 @@ static const char *help_string =
" the squashfs image.\n"
" --cat, -c <path> If the specified path is a regular file in the,\n"
" image, dump its contents to stdout.\n"
+" --xattr, -x <path> Enumerate extended attributes associated with\n"
+" an inode that the given path resolves to.\n"
" --unpack-path, -u <path> 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);