Hello I would like to propose this patch to check the priority when used with:
TMPDIR=/tmp/ mktemp -t -p should-not-be-used foo.XXX -p should be ignore in this case. And this behavior isn't checked in the testsuite. Thanks Sylvestre
From 3fe51ad72536579854907496c2b221b95f695e53 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru <sylves...@debian.org> Date: Mon, 3 Jul 2023 23:37:11 +0200 Subject: [PATCH] test: mktemp: TEMPDIR has higher priority than -p --- tests/misc/mktemp.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/misc/mktemp.pl b/tests/misc/mktemp.pl index 7fb2e16e9..742b1c6f0 100755 --- a/tests/misc/mktemp.pl +++ b/tests/misc/mktemp.pl @@ -183,6 +183,12 @@ my @Tests = check_tmp $f, 'F'; unlink $f; rmdir 'a' or die "rmdir a: $!\n" }} ], + ['priority-tempdir', '-t -p should_not_attempt_to_write_in_this_nonexisting_dir foo.XXX', + {ENV=>"TMPDIR=."}, + {OUT_SUBST => 's,....$,.ZZZ,'}, + {OUT => "./foo.ZZZ\n"}, + ], + ['pipe-bad-tmpdir', {ENV => "TMPDIR=$bad_dir"}, {ERR_SUBST => "s,($bad_dir/)[^']+': .*,\$1...,"}, -- 2.40.1