]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - krb5/patches/krb5-1.3.4-send-pr-tempfile.patch
samba: build with needed packages
[people/amarx/ipfire-3.x.git] / krb5 / patches / krb5-1.3.4-send-pr-tempfile.patch
CommitLineData
6cf77d05
SS
1Use mktemp to create our temporary files instead of basing them on our PID.
2Only portable if you assume the presence of a mktemp helper.
3diff -ur krb5-1.3.4/src/util/send-pr/send-pr.sh krb5-1.3.4/src/util/send-pr/send-pr.sh
4--- krb5-1.3.4/src/util/send-pr/send-pr.sh 1997-03-20 01:13:56.000000000 +0100
5+++ krb5-1.3.4/src/util/send-pr/send-pr.sh 2004-09-20 11:28:56.000000000 +0200
6@@ -96,9 +96,9 @@
7 fi
8 fi
9
10-TEMP=$TMPDIR/p$$
11-BAD=$TMPDIR/pbad$$
12-REF=$TMPDIR/pf$$
13+TEMP=`mktemp "$TMPDIR"/p.XXXXXX` || exit 1
14+BAD=`mktemp "$TMPDIR"/pbad.XXXXXX` || exit 1
15+REF=`mktemp "$TMPDIR"/pf.XXXXXX` || exit 1
16
17 # find a user name
18 if [ "$LOGNAME" = "" ]; then
19@@ -122,9 +122,10 @@
20 else
21 # Must use temp file due to incompatibilities in quoting behavior
22 # and to protect shell metacharacters in the expansion of $LOGNAME
23- $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP
24- ORIGINATOR="`cat $TEMP`"
25- rm -f $TEMP
26+ TEMP2=`mktemp "$TMPDIR"/plogname.XXXXXX` || exit 1
27+ $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP2
28+ ORIGINATOR="`cat $TEMP2`"
29+ rm -f $TEMP2
30 fi
31
32 if [ -n "$ORGANIZATION" ]; then
33@@ -280,7 +281,7 @@
34 # Catch some signals. ($xs kludge needed by Sun /bin/sh)
35 xs=0
36 trap 'rm -f $REF $TEMP; exit $xs' 0
37-trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 2 3 13 15
38+trap 'echo "$COMMAND: Aborting ..."; rm -f "$REF" "$BAD" "$TEMP"; xs=1; exit' 1 2 3 13 15
39
40 # If they told us to use a specific file, then do so.
41 if [ -n "$IN_FILE" ]; then