Warning!

Notice: the grml team is migrating from Mercurial to Git.
Please visit git.grml.org instead!

check for existing tmpfiles at beginn of script; do not export PATH
authorMichael Prokop <mika@grml.org>
Sat Dec 16 10:34:50 2006 +0100 (23 months ago)
changeset 114345a9cc00f8
manifest4345a9cc00f8
parent 10ffa45aa47eae
child 1285ce02b9bd47
tag0.3-18
check for existing tmpfiles at beginn of script; do not export PATH
debian/changelog
rebuildfstab
--- a/debian/changelog Thu Dec 07 18:59:15 2006 +0100
+++ b/debian/changelog Sat Dec 16 10:34:50 2006 +0100
@@ -1,3 +1,11 @@ grml-rebuildfstab (0.3-17) unstable; urg
+grml-rebuildfstab (0.3-18) unstable; urgency=low
+
+ * Add check for existing tmpfiles at beginn of script to
+ beautify error handling on read-only /.
+ * Do not export $PATH.
+
+ -- Michael Prokop <mika@grml.org> Sat, 16 Dec 2006 10:33:52 +0100
+
grml-rebuildfstab (0.3-17) unstable; urgency=low
* Adjust sysfs entry for fstab template so initscript
--- a/rebuildfstab Thu Dec 07 18:59:15 2006 +0100
+++ b/rebuildfstab Sat Dec 16 10:34:50 2006 +0100
@@ -4,7 +4,7 @@
# Authors: grml-team (grml.org), (c) Klaus Knopper Nov 2002, (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Son Dez 03 13:38:25 CET 2006 [mika]
+# Latest change: Sam Dez 16 10:33:40 CET 2006 [mika]
################################################################################
# This script is based on the package rebuildfstab-knoppix_0.5-4 of Klaus Knopper.
# (C) Klaus Knopper Nov 2002
@@ -31,12 +31,18 @@ function logit() {
exec sudo $0 "$@"
}
-export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+PATH="/bin:/sbin:/usr/bin:/usr/sbin"
MNTFILE="/mnt/.grml-auto-created_do-not-delete-this-file"
-TMP=$(mktemp)
-TMPFILE=$(mktemp)
+TMP=$(mktemp 2>/dev/null)
+TMPFILE=$(mktemp 2>/dev/null)
ADDEDBYGRML="# Added by GRML"
umask 022
+
+if [ -z "$TMP" -o -z "$TMPFILE" ] ; then
+ echo "$0: could not create tmpfile (is / mounted read-only?), exiting" >&2
+ logit 'fatal - could not create tmpfile (is / mounted read-only?), exiting'
+ exit 1
+fi
trap "rm -f $TMP $TMPFILE" 2 3 11