]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: let modprinter.pl use $TMPDIR
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Jul 2024 09:46:57 +0000 (11:46 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Jul 2024 13:53:13 +0000 (13:53 +0000)
We should avoid using /tmp in selftest

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 23 13:53:13 UTC 2024 on atb-devel-224

source3/script/tests/printing/modprinter.pl

index 28817dbd284b5e71fec04f973db7d494cf2070c8..bfe395a85098f4d3541eabdf965d0710a157dd81 100755 (executable)
@@ -122,7 +122,11 @@ while (<CONFIGFILE>) {
        }
 }
 if ($opt_add) {
-       print CONFIGFILE_NEW "[$share_name]\n\tprintable = yes\n\tpath = /tmp\n";
+       my $tmpdir = "/tmp";
+       if (defined($ENV{TMPDIR})) {
+               $tmpdir = $ENV{TMPDIR};
+       }
+       print CONFIGFILE_NEW "[$share_name]\n\tprintable = yes\n\tpath = $tmpdir\n";
 }
 close (CONFIGFILE);
 close (CONFIGFILE_NEW);