Skip to contentSkip to conversation

dracut: use TMPDIR defintion

PATCH In review maximilian attems 2 participants 2 messages May 16, 2011 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dracut: use TMPDIR defintion

mktemp has marked the "-t" as deprecated.
TMPDIR is anyway write guarded just a line above since dracut 003.

---
 dracut |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dracut +1 -1
index d19c162..e018061 100755
@@ -452,7 +452,7 @@ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
 fi
 
 [[ $TMPDIR && ! -w $TMPDIR ]] && unset TMPDIR
-readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
+readonly initdir=$(mktemp --tmpdir=${TMPDIR:-/var/tmp/} -d initramfs.XXXXXX)
 
 # clean up after ourselves no matter how we die.
 trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT
Signature · 1 line
1.7.4.4
#2 lore raw
In reply to a message not in the archive

Am 16.05.2011 17:46, schrieb maximilian attems:

Quoted 13 lines

mktemp has marked the "-t" as deprecated.
TMPDIR is anyway write guarded just a line above since dracut 003.

---
 dracut |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
dracut +0 -0
index d19c162..e018061 100755

dracut elif [[ -f "$outfile" && ! -w "$outfile" ]]; then · line 454

Quoted 3 lines
dracut +0 -0
@@ -452,7 +452,7 @@ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
 fi
 
 [[ $TMPDIR && ! -w $TMPDIR ]] && unset TMPDIR

We should even remove the above line, because we really want /var/tmp here. /tmp might be to small and we want to prevent accidents (like as we do, when we set $PATH)

Quoted 5 lines
dracut +1 -1
-readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
+readonly initdir=$(mktemp --tmpdir=${TMPDIR:-/var/tmp/} -d initramfs.XXXXXX)
 
 # clean up after ourselves no matter how we die.
 trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT