r3004 - in trunk/utils/initrd-tools: . debian

maximilian attems maks-guest@costa.debian.org
Thu, 28 Apr 2005 08:08:42 +0000


Author: maks-guest
Date: 2005-04-28 08:08:41 +0000 (Thu, 28 Apr 2005)
New Revision: 3004

Modified:
   trunk/utils/initrd-tools/debian/changelog
   trunk/utils/initrd-tools/mkinitrd
Log:
now security stuff,
use mktemp instead of possible insecure temporary dir.


Modified: trunk/utils/initrd-tools/debian/changelog
===================================================================
--- trunk/utils/initrd-tools/debian/changelog	2005-04-28 08:04:11 UTC (rev 3003)
+++ trunk/utils/initrd-tools/debian/changelog	2005-04-28 08:08:41 UTC (rev 3004)
@@ -9,6 +9,7 @@
     - Resynchronise with Ubuntu:
       * Error message should refer to mdadm, not raidtools2.
       * Take /etc/mkinitrd/DSDT and put it in the initrd if it exists.
+      * Use mktemp, not $$ for creating temporary directories.
 
  -- Steve Langasek <vorlon@debian.org>  Sun, 10 Apr 2005 15:38:08 -0700
 

Modified: trunk/utils/initrd-tools/mkinitrd
===================================================================
--- trunk/utils/initrd-tools/mkinitrd	2005-04-28 08:04:11 UTC (rev 3003)
+++ trunk/utils/initrd-tools/mkinitrd	2005-04-28 08:08:41 UTC (rev 3004)
@@ -1362,10 +1362,10 @@
 	trap "DSIG=$i; exit" $i
 done
 
-workdir=${TMPDIR:-/tmp}/mkinitrd.$$
+workdir=$(mktemp -d -t mkinitrd.XXXXXX)
 eval "$(
 	trap '' HUP INT TERM
-	if ! mkdir $workdir; then
+	if [ ! -d $workdir ]; then
 		echo "$PROG: $workdir: Cannot create temporary directory" >&2
 		echo exit 1
 		exit