|
Line 0
Link Here
|
|
|
1 |
# remove expr GNUisms: use BRE syntax and remove match, based on |
| 2 |
# upstream commit e3bab0cc706880c22f2b205e7abad9d8c0227071, but |
| 3 |
# also shield expr from leading dash of X server args. |
| 4 |
# |
| 5 |
# generate displayname as dictated in the xauth manpage |
| 6 |
# |
| 7 |
--- startx.cpp.orig 2014-09-11 17:31:42 UTC |
| 8 |
+++ startx.cpp |
| 9 |
@@ -154,7 +154,7 @@ while [ x"$1" != x ]; do |
| 10 |
else |
| 11 |
XCOMM display must be the FIRST server argument |
| 12 |
if [ x"$serverargs" = x ] && @@ |
| 13 |
- expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then |
| 14 |
+ expr \( "$1" \) : ':[0-9][0-9]*$' > /dev/null 2>&1; then |
| 15 |
display="$1" |
| 16 |
else |
| 17 |
serverargs="$serverargs $1" |
| 18 |
@@ -193,7 +193,7 @@ if [ x"$server" = x ]; then |
| 19 |
XCOMM the startx session being seen as inactive: |
| 20 |
XCOMM "https://bugzilla.redhat.com/show_bug.cgi?id=806491" |
| 21 |
tty=$(tty) |
| 22 |
- if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then |
| 23 |
+ if expr "$tty" : '/dev/tty[0-9][0-9]*$' > /dev/null; then |
| 24 |
tty_num=$(echo "$tty" | grep -oE '[0-9]+$') |
| 25 |
vtarg="vt$tty_num" |
| 26 |
fi |
| 27 |
@@ -217,7 +217,7 @@ fi |
| 28 |
XCOMM if no vt is specified add vtarg (which may be empty) |
| 29 |
have_vtarg="no" |
| 30 |
for i in $serverargs; do |
| 31 |
- if expr match "$i" '^vt[0-9]\+$' > /dev/null; then |
| 32 |
+ if expr \( "$i" \) : 'vt[0-9][0-9]*$' > /dev/null; then |
| 33 |
have_vtarg="yes" |
| 34 |
fi |
| 35 |
done |
| 36 |
@@ -283,10 +283,10 @@ EOF |
| 37 |
|
| 38 |
XCOMM now add the same credentials to the client authority file |
| 39 |
XCOMM if '$displayname' already exists do not overwrite it as another |
| 40 |
- XCOMM server man need it. Add them to the '$xserverauthfile' instead. |
| 41 |
- for displayname in $authdisplay $hostname$authdisplay; do |
| 42 |
+ XCOMM server may need it. Add them to the '$xserverauthfile' instead. |
| 43 |
+ for displayname in $authdisplay $hostname/unix$authdisplay; do |
| 44 |
authcookie=`XAUTH list "$displayname" @@ |
| 45 |
- | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; |
| 46 |
+ | sed -n "s|.*$displayname[[:space:]*].*[[:space:]*]||p"` 2>/dev/null; |
| 47 |
if [ "z${authcookie}" = "z" ] ; then |
| 48 |
XAUTH -q << EOF |
| 49 |
add $displayname . $mcookie |