Use mktemp and use it properly.
* fixes bug 632879 and bug 499234 (which is CVE-2009-1573)
Signed-off-by: Matěj Cepl <mcepl@redhat.com>
(cherry picked from commit 6753065f95
)
This commit is contained in:
parent
3cf5861486
commit
41b6300ced
@ -30,7 +30,7 @@
|
|||||||
Summary: X.Org X11 X server
|
Summary: X.Org X11 X server
|
||||||
Name: xorg-x11-server
|
Name: xorg-x11-server
|
||||||
Version: 1.9.0
|
Version: 1.9.0
|
||||||
Release: 7%{?gitdate:.%{gitdate}}%{dist}
|
Release: 8%{?gitdate:.%{gitdate}}%{dist}
|
||||||
URL: http://www.x.org
|
URL: http://www.x.org
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: User Interface/X
|
Group: User Interface/X
|
||||||
@ -554,6 +554,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{xserver_source_dir}
|
%{xserver_source_dir}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Sep 13 2010 Matěj Cepl <mcepl@redhat.com> - 1.9.0-8
|
||||||
|
- Call mktemp correctly (fixes RHBZ bug 632879
|
||||||
|
|
||||||
* Thu Sep 02 2010 Adam Jackson <ajax@redhat.com> 1.9.0-7
|
* Thu Sep 02 2010 Adam Jackson <ajax@redhat.com> 1.9.0-7
|
||||||
- ... but only in F15 and later.
|
- ... but only in F15 and later.
|
||||||
|
|
||||||
|
16
xvfb-run.sh
16
xvfb-run.sh
@ -146,19 +146,17 @@ fi
|
|||||||
# If the user did not specify an X authorization file to use, set up a temporary
|
# If the user did not specify an X authorization file to use, set up a temporary
|
||||||
# directory to house one.
|
# directory to house one.
|
||||||
if [ -z "$AUTHFILE" ]; then
|
if [ -z "$AUTHFILE" ]; then
|
||||||
XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$"
|
XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)"
|
||||||
if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
|
AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXX)
|
||||||
error "temporary directory $XVFB_RUN_TMPDIR already exists"
|
|
||||||
exit 4
|
|
||||||
fi
|
|
||||||
AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start Xvfb.
|
# Start Xvfb.
|
||||||
MCOOKIE=$(mcookie)
|
MCOOKIE=$(mcookie)
|
||||||
XAUTHORITY=$AUTHFILE xauth add ":$SERVERNUM" "$XAUTHPROTO" "$MCOOKIE" \
|
|
||||||
>"$ERRORFILE" 2>&1
|
XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1
|
||||||
XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >"$ERRORFILE" \
|
add :$SERVERNUM $XAUTHPROTO $MCOOKIE
|
||||||
|
EOF
|
||||||
|
XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \
|
||||||
2>&1 &
|
2>&1 &
|
||||||
XVFBPID=$!
|
XVFBPID=$!
|
||||||
sleep "$STARTWAIT"
|
sleep "$STARTWAIT"
|
||||||
|
Loading…
Reference in New Issue
Block a user