From d731b1222e17e0081e5e4e1fc9603b67ba0b72e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:30:36 +0200 Subject: Adding debian version 2.38.1-5. Signed-off-by: Daniel Baumann --- ...cript-abort-if-unused-arguments-are-given.patch | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 debian/patches/upstream/PATCH-script-abort-if-unused-arguments-are-given.patch (limited to 'debian/patches/upstream/PATCH-script-abort-if-unused-arguments-are-given.patch') diff --git a/debian/patches/upstream/PATCH-script-abort-if-unused-arguments-are-given.patch b/debian/patches/upstream/PATCH-script-abort-if-unused-arguments-are-given.patch new file mode 100644 index 0000000..98b2668 --- /dev/null +++ b/debian/patches/upstream/PATCH-script-abort-if-unused-arguments-are-given.patch @@ -0,0 +1,56 @@ +From: Chris Hofstaedtler +Date: Fri, 18 Nov 2022 13:23:37 +0000 +Subject: [PATCH] script: abort if unused arguments are given +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +scripts uses either a free-standing "file" argument, or the value +passed as --log-out "file". Additional filenames are ignored. +They are also ignored if --log-in "file" is given, as it turns off +output logging by default (can still be overriden by adding --log-out). +Avoid surprises when passing multiple filenames by writing usage +message instead. + +[kzak@redhat.com: - use errtryhelp() rather than usage()] + +Signed-off-by: Chris Hofstaedtler +Reported-by: наб +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1016193 +Signed-off-by: Karel Zak +--- + term-utils/script.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/term-utils/script.c b/term-utils/script.c +index c918ecd..e03a1c3 100644 +--- a/term-utils/script.c ++++ b/term-utils/script.c +@@ -889,9 +889,11 @@ int main(int argc, char **argv) + + /* default if no --log-* specified */ + if (!outfile && !infile) { +- if (argc > 0) ++ if (argc > 0) { + outfile = argv[0]; +- else { ++ argc--; ++ argv++; ++ } else { + die_if_link(&ctl, DEFAULT_TYPESCRIPT_FILENAME); + outfile = DEFAULT_TYPESCRIPT_FILENAME; + } +@@ -900,6 +902,13 @@ int main(int argc, char **argv) + log_associate(&ctl, &ctl.out, outfile, SCRIPT_FMT_RAW); + } + ++ if (argc > 0) { ++ /* only one filename is accepted. if --log-out was given, ++ * freestanding filename is ignored */ ++ warnx(_("unexpected number of arguments")); ++ errtryhelp(EXIT_FAILURE); ++ } ++ + if (timingfile) { + /* the old SCRIPT_FMT_TIMING_SIMPLE should be used when + * recoding output only (just for backward compatibility), -- cgit v1.2.3