From f6e6d6ee51f6394913da1f67297c0fcf92d806f9 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 25 Nov 2009 00:50:05 +0100 Subject: [PATCH] Proberly use UID check and escape $0 --- debian/changelog | 7 +++++++ grml2usb | 2 +- grml2usb-compat | 2 +- tarball.sh | 8 ++++---- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1d5175f..df493c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml2usb (0.9.20) unstable; urgency=low + + * tarball.sh: do not use $UID but use $(id -u) instead so it proberly + works with dash and make sure to escape "$0". Thanks to Stefan Weiss! + + -- Michael Prokop Wed, 25 Nov 2009 00:47:36 +0100 + grml2usb (0.9.19) unstable; urgency=low [ Ulrich Dangel ] diff --git a/grml2usb b/grml2usb index c09f2a1..0ada392 100755 --- a/grml2usb +++ b/grml2usb @@ -20,7 +20,7 @@ import fileinput import glob # global variables -PROG_VERSION = "0.9.19" +PROG_VERSION = "0.9.20" MOUNTED = set() # register mountpoints TMPFILES = set() # register tmpfiles DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg diff --git a/grml2usb-compat b/grml2usb-compat index fd3cb69..a31c008 100755 --- a/grml2usb-compat +++ b/grml2usb-compat @@ -18,7 +18,7 @@ from inspect import isroutine, isclass import datetime, logging, os, re, subprocess, sys, tempfile, time, os.path # global variables -PROG_VERSION = "0.9.19" +PROG_VERSION = "0.9.20" MOUNTED = set() # register mountpoints TMPFILES = set() # register tmpfiles DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifier for syslinux.cfg diff --git a/tarball.sh b/tarball.sh index d5f850e..895d3ed 100755 --- a/tarball.sh +++ b/tarball.sh @@ -43,8 +43,8 @@ cat > "${DIR}"/install.sh << EOF set -e -if [ "\$UID" != 0 ] ; then - echo "Error: become root before starting $0" >& 2 +if [ \$(id -u) != 0 ] ; then + echo "Error: become root before starting \$0" >& 2 exit 1 fi @@ -93,8 +93,8 @@ cat > "${DIR}"/uninstall.sh << EOF set -e -if [ "\$UID" != 0 ] ; then - echo "Error: become root before starting $0" >& 2 +if [ \$(id -u) != 0 ] ; then + echo "Error: become root before starting \$0" >& 2 exit 1 fi -- 2.1.4