gzip zwalony
Michal Moskal
malekith w pld.org.pl
Sob, 9 Cze 2001, 16:32:17 CEST
a konkretnie gzexe. ale juz poprawilem tylko sie lock nie umiem
doczekac, napisalem w specu stbr i nie commtinalem pacza...
jak juz bedzie dzialac... zalaczam pacz
--
: Michal ``,/\/\, '' Moskal | | : GCS {C,UL}++++$
: | |alekith @ |)|(| . org . pl : {E--, W, w-,M}-
: | : {b,e>+}++ !tv h
: Current project: http://aleph-0.dhs.org/ywindow/ : PLD Team member
-------------- następna część ---------
diff -ur gzip-1.3/gzexe.in gzip-1.3-/gzexe.in
--- gzip-1.3/gzexe.in Fri Sep 18 02:43:06 1998
+++ gzip-1.3-/gzexe.in Sat Jun 9 16:05:41 2001
@@ -91,21 +91,21 @@
sed 1q $0 > $tmp
sed "s|^if tail|if $tail|" >> $tmp <<'EOF'
skip=22
-set -C
umask=`umask`
umask 77
-if tail +$skip $0 | "BINDIR"/gzip -cd > /tmp/gztmp$$; then
+tmpfile=`mktemp /tmp/gz$$.XXXXXX` || { echo 'cannot create temporary file' >&2; exit 1; }
+if tail +$skip $0 | "/bin"/gzip -cd > $tmpfile; then
umask $umask
- /bin/chmod 700 /tmp/gztmp$$
+ /bin/chmod 700 $tmpfile
prog="`echo $0 | /bin/sed 's|^.*/||'`"
- if /bin/ln /tmp/gztmp$$ "/tmp/$prog" 2>/dev/null; then
- trap '/bin/rm -f /tmp/gztmp$$ "/tmp/$prog"; exit $res' 0
- (/bin/sleep 5; /bin/rm -f /tmp/gztmp$$ "/tmp/$prog") 2>/dev/null &
+ if /bin/ln $tmpfile "/tmp/$prog" 2>/dev/null; then
+ trap '/bin/rm -f $tmpfile "/tmp/$prog"; exit $res' 0
+ (/bin/sleep 5; /bin/rm -f $tmpfile "/tmp/$prog") 2>/dev/null &
/tmp/"$prog" ${1+"$@"}; res=$?
else
- trap '/bin/rm -f /tmp/gztmp$$; exit $res' 0
- (/bin/sleep 5; /bin/rm -f /tmp/gztmp$$) 2>/dev/null &
- /tmp/gztmp$$ ${1+"$@"}; res=$?
+ trap '/bin/rm -f /tmp/$tmpfile; exit $res' 0
+ (/bin/sleep 5; /bin/rm -f $tmpfile) 2>/dev/null &
+ $tmpfile ${1+"$@"}; res=$?
fi
else
echo Cannot decompress $0; exit 1
Więcej informacji o liście dyskusyjnej pld-devel-pl