summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>1999-01-28 21:28:27 +0000
committerHerb Lewis <herb@samba.org>1999-01-28 21:28:27 +0000
commit59255f5db7c8613b68f5828d3debc18bb4090c9f (patch)
tree4326c2808d608113ad6364d184f71b5fd44582cc
parentd4be42abc6a49f0d9859662334add533b9965b7d (diff)
downloadsamba-59255f5db7c8613b68f5828d3debc18bb4090c9f.tar.gz
samba-59255f5db7c8613b68f5828d3debc18bb4090c9f.tar.xz
samba-59255f5db7c8613b68f5828d3debc18bb4090c9f.zip
fix for print files not being removed after printing. Samba was doing a
cd to the directory and only passing the filename not a full path so the test for the file being in a tmp directory failed.
-rw-r--r--packaging/SGI/sambalp11
1 files changed, 9 insertions, 2 deletions
diff --git a/packaging/SGI/sambalp b/packaging/SGI/sambalp
index fd0cef8f933..61e62215c91 100644
--- a/packaging/SGI/sambalp
+++ b/packaging/SGI/sambalp
@@ -146,5 +146,12 @@ if ($PSFIX) { # are we running a "psfix"?
system("$lpcommand $file");
}
-# Remove the file only if it lives in /usr/tmp, /tmp, or /var/tmp.
-unlink($file) if $file =~ m=^(/(usr|var))?/tmp=;
+if ($file =~ m(^/)) {
+ # $file is a fully specified path
+ # Remove the file only if it lives in a directory ending in /tmp.
+ unlink($file) if ($file =~ m(/tmp/[^/]+$));
+} else {
+ # $file is NOT a fully specified path
+ # Remove the file only if current directory ends in /tmp.
+ unlink($file) if (`pwd` =~ m(/tmp$));
+}