]> git.ipfire.org Git - thirdparty/tar.git/commit
Accept only position-sensitive (file-selection) options in file list files.
authorSergey Poznyakoff <gray@gnu.org>
Wed, 24 Jun 2020 13:43:26 +0000 (16:43 +0300)
committerSergey Poznyakoff <gray@gnu.org>
Wed, 24 Jun 2020 13:43:26 +0000 (16:43 +0300)
commit1ff0b63f48988ed2a94d42d52f7a81602f874cc8
tree071efe97c7d5c11d2bc7fa85c063ecd9ca80b08f
parent34d15af170a5d6e60b70979001e8940d9a382f35
Accept only position-sensitive (file-selection) options in file list files.

Using such options as -f, -z, etc. is senseless in the file list file
and bypasses the option consistency checks in decode_options.  Therefore,
only options related to file selection (a.k.a position-sensitive options)
are allowed in files.

* doc/tar.texi: Document changes.
* src/common.h (tar_args): Move from tar.c
(TAR_ARGS_INITIALIZER): New macro.
* src/names.c: Declare option group identifiers as an enum.
(names_parse_opt): Special handling for ARGP_KEY_ERROR.
(names_argp): Remove static qualifier.
(names_argp_children): Remove.
* src/tar.c: Declare option group identifiers as an enum.
(parse_opt): Special handling for ARGP_KEY_INIT.
(argp_children): New static variable.
(args): Remove static variable.
(more_options): Allow only options from names_argp.
(parse_default_options): Take a pointer to struct tar_args as argument.
Replace the loc member during the call to argp_parse and restore it
afterwards.
(decode_options): Use automatic variable for args.
doc/tar.texi
src/common.h
src/names.c
src/tar.c