diff --git a/source3/script/tests/printing/modprinter.pl b/source3/script/tests/printing/modprinter.pl index 28817dbd284..bfe395a8509 100755 --- a/source3/script/tests/printing/modprinter.pl +++ b/source3/script/tests/printing/modprinter.pl @@ -122,7 +122,11 @@ while () { } } 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);