SECURITY: quote the arguments to true

This commit is contained in:
tg 2015-07-09 20:11:45 +00:00
parent d034be7a84
commit f274f18223
2 changed files with 37 additions and 37 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.686 2015/07/09 19:59:13 tg Exp $' srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.687 2015/07/09 20:11:44 tg Exp $'
#- #-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013, 2014, 2015 # 2011, 2012, 2013, 2014, 2015
@ -683,14 +683,14 @@ esac
# Configuration depending on OS name # Configuration depending on OS name
case $TARGET_OS in case $TARGET_OS in
386BSD) 386BSD)
: ${HAVE_CAN_OTWO=0} : "${HAVE_CAN_OTWO=0}"
add_cppflags -DMKSH_NO_SIGSETJMP add_cppflags -DMKSH_NO_SIGSETJMP
add_cppflags -DMKSH_TYPEDEF_SIG_ATOMIC_T=int add_cppflags -DMKSH_TYPEDEF_SIG_ATOMIC_T=int
add_cppflags -DMKSH_CONSERVATIVE_FDS add_cppflags -DMKSH_CONSERVATIVE_FDS
;; ;;
AIX) AIX)
add_cppflags -D_ALL_SOURCE add_cppflags -D_ALL_SOURCE
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
BeOS) BeOS)
case $KSH_VERSION in case $KSH_VERSION in
@ -709,7 +709,7 @@ BeOS)
add_cppflags -DMKSH__NO_SETEUGID add_cppflags -DMKSH__NO_SETEUGID
;; ;;
BSD/OS) BSD/OS)
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
Coherent) Coherent)
oswarn="; it has major issues" oswarn="; it has major issues"
@ -720,7 +720,7 @@ Coherent)
add_cppflags -DMKSH_DISABLE_TTY_WARNING add_cppflags -DMKSH_DISABLE_TTY_WARNING
;; ;;
CYGWIN*) CYGWIN*)
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
Darwin) Darwin)
add_cppflags -D_DARWIN_C_SOURCE add_cppflags -D_DARWIN_C_SOURCE
@ -733,7 +733,7 @@ FreeMiNT)
oswarn="; it has minor issues" oswarn="; it has minor issues"
add_cppflags -D_GNU_SOURCE add_cppflags -D_GNU_SOURCE
add_cppflags -DMKSH_CONSERVATIVE_FDS add_cppflags -DMKSH_CONSERVATIVE_FDS
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
GNU) GNU)
case $CC in case $CC in
@ -758,11 +758,11 @@ Interix)
ccpc='-X ' ccpc='-X '
ccpl='-Y ' ccpl='-Y '
add_cppflags -D_ALL_SOURCE add_cppflags -D_ALL_SOURCE
: ${LIBS='-lcrypt'} : "${LIBS=-lcrypt}"
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
IRIX*) IRIX*)
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
Linux) Linux)
case $CC in case $CC in
@ -770,7 +770,7 @@ Linux)
*) add_cppflags -D_GNU_SOURCE ;; *) add_cppflags -D_GNU_SOURCE ;;
esac esac
add_cppflags -DSETUID_CAN_FAIL_WITH_EAGAIN add_cppflags -DSETUID_CAN_FAIL_WITH_EAGAIN
: ${HAVE_REVOKE=0} : "${HAVE_REVOKE=0}"
;; ;;
LynxOS) LynxOS)
oswarn="; it has minor issues" oswarn="; it has minor issues"
@ -783,7 +783,7 @@ Minix-vmd)
add_cppflags -DMKSH_CONSERVATIVE_FDS add_cppflags -DMKSH_CONSERVATIVE_FDS
add_cppflags -D_MINIX_SOURCE add_cppflags -D_MINIX_SOURCE
oldish_ed=no-stderr-ed # no /bin/ed, maybe see below oldish_ed=no-stderr-ed # no /bin/ed, maybe see below
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
Minix3) Minix3)
add_cppflags -DMKSH_UNEMPLOYED add_cppflags -DMKSH_UNEMPLOYED
@ -791,23 +791,24 @@ Minix3)
add_cppflags -DMKSH_NO_LIMITS add_cppflags -DMKSH_NO_LIMITS
add_cppflags -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_MINIX add_cppflags -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_MINIX
oldish_ed=no-stderr-ed # /usr/bin/ed(!) is broken oldish_ed=no-stderr-ed # /usr/bin/ed(!) is broken
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
MirBSD) MirBSD)
;; ;;
MSYS_*) MSYS_*)
add_cppflags -DMKSH_ASSUME_UTF8=0; HAVE_ISSET_MKSH_ASSUME_UTF8=1 add_cppflags -DMKSH_ASSUME_UTF8=0; HAVE_ISSET_MKSH_ASSUME_UTF8=1
# almost same as CYGWIN* (from RT|Chatzilla) # almost same as CYGWIN* (from RT|Chatzilla)
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
# broken on this OE (from ir0nh34d) # broken on this OE (from ir0nh34d)
: ${HAVE_STDINT_H=0} : "${HAVE_STDINT_H=0}"
;; ;;
NetBSD) NetBSD)
;; ;;
NEXTSTEP) NEXTSTEP)
add_cppflags -D_NEXT_SOURCE add_cppflags -D_NEXT_SOURCE
add_cppflags -D_POSIX_SOURCE add_cppflags -D_POSIX_SOURCE
: ${AWK=gawk} ${CC=cc -posix} : "${AWK=gawk}"
: "${CC=cc -posix}"
add_cppflags -DMKSH_NO_SIGSETJMP add_cppflags -DMKSH_NO_SIGSETJMP
# NeXTstep cannot get a controlling tty # NeXTstep cannot get a controlling tty
add_cppflags -DMKSH_UNEMPLOYED add_cppflags -DMKSH_UNEMPLOYED
@ -828,14 +829,14 @@ Ninix3)
oswarn="; it has unknown issues" oswarn="; it has unknown issues"
;; ;;
OpenBSD) OpenBSD)
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
OS/2) OS/2)
HAVE_MKNOD=0 # setmode() incompatible HAVE_MKNOD=0 # setmode() incompatible
oswarn="; it is currently being ported" oswarn="; it is currently being ported"
check_categories="$check_categories nosymlink" check_categories="$check_categories nosymlink"
: ${CC=gcc} : "${CC=gcc}"
: ${SIZE=: size} : "${SIZE=: size}"
add_cppflags -DMKSH_UNEMPLOYED add_cppflags -DMKSH_UNEMPLOYED
add_cppflags -DMKSH_NOPROSPECTOFWORK add_cppflags -DMKSH_NOPROSPECTOFWORK
;; ;;
@ -845,7 +846,7 @@ OSF1)
add_cppflags -D_POSIX_C_SOURCE=200112L add_cppflags -D_POSIX_C_SOURCE=200112L
add_cppflags -D_XOPEN_SOURCE=600 add_cppflags -D_XOPEN_SOURCE=600
add_cppflags -D_XOPEN_SOURCE_EXTENDED add_cppflags -D_XOPEN_SOURCE_EXTENDED
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
Plan9) Plan9)
add_cppflags -D_POSIX_SOURCE add_cppflags -D_POSIX_SOURCE
@ -863,7 +864,7 @@ Plan9)
PW32*) PW32*)
HAVE_SIG_T=0 # incompatible HAVE_SIG_T=0 # incompatible
oswarn=' and will currently not work' oswarn=' and will currently not work'
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
QNX) QNX)
add_cppflags -D__NO_EXT_QNX add_cppflags -D__NO_EXT_QNX
@ -873,7 +874,7 @@ QNX)
oldish_ed=no-stderr-ed # oldish /bin/ed is broken oldish_ed=no-stderr-ed # oldish /bin/ed is broken
;; ;;
esac esac
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
SCO_SV) SCO_SV)
case $TARGET_OSREV in case $TARGET_OSREV in
@ -890,7 +891,7 @@ SCO_SV)
;; ;;
esac esac
add_cppflags -DMKSH_CONSERVATIVE_FDS add_cppflags -DMKSH_CONSERVATIVE_FDS
: ${HAVE_SYS_SIGLIST=0} ${HAVE__SYS_SIGLIST=0} : "${HAVE_SYS_SIGLIST=0}${HAVE__SYS_SIGLIST=0}"
;; ;;
skyos) skyos)
oswarn="; it has minor issues" oswarn="; it has minor issues"
@ -905,15 +906,15 @@ syllable)
oswarn=' and will currently not work' oswarn=' and will currently not work'
;; ;;
ULTRIX) ULTRIX)
: ${CC=cc -YPOSIX} : "${CC=cc -YPOSIX}"
add_cppflags -DMKSH_TYPEDEF_SSIZE_T=int add_cppflags -DMKSH_TYPEDEF_SSIZE_T=int
add_cppflags -DMKSH_CONSERVATIVE_FDS add_cppflags -DMKSH_CONSERVATIVE_FDS
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
UnixWare|UNIX_SV) UnixWare|UNIX_SV)
# SCO UnixWare # SCO UnixWare
add_cppflags -DMKSH_CONSERVATIVE_FDS add_cppflags -DMKSH_CONSERVATIVE_FDS
: ${HAVE_SYS_SIGLIST=0} ${HAVE__SYS_SIGLIST=0} : "${HAVE_SYS_SIGLIST=0}${HAVE__SYS_SIGLIST=0}"
;; ;;
UWIN*) UWIN*)
ccpc='-Yc,' ccpc='-Yc,'
@ -921,7 +922,7 @@ UWIN*)
tsts=" 3<>/dev/tty" tsts=" 3<>/dev/tty"
oswarn="; it will compile, but the target" oswarn="; it will compile, but the target"
oswarn="$oswarn${nl}platform itself is very flakey/unreliable" oswarn="$oswarn${nl}platform itself is very flakey/unreliable"
: ${HAVE_SETLOCALE_CTYPE=0} : "${HAVE_SETLOCALE_CTYPE=0}"
;; ;;
_svr4) _svr4)
# generic target for SVR4 Unix with uname -s = uname -n # generic target for SVR4 Unix with uname -s = uname -n
@ -935,9 +936,9 @@ _svr4)
;; ;;
esac esac
: ${HAVE_MKNOD=0} : "${HAVE_MKNOD=0}"
: ${AWK=awk} ${CC=cc} ${NROFF=nroff} ${SIZE=size} : "${AWK=awk}${CC=cc}${NROFF=nroff}${SIZE=size}"
test 0 = $r && echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && \ test 0 = $r && echo | $NROFF -v 2>&1 | grep GNU >/dev/null 2>&1 && \
echo | $NROFF -c >/dev/null 2>&1 && NROFF="$NROFF -c" echo | $NROFF -c >/dev/null 2>&1 && NROFF="$NROFF -c"
@ -1204,7 +1205,7 @@ uslc)
SCO_SV:3.2*) SCO_SV:3.2*)
# SCO OpenServer 5 # SCO OpenServer 5
CFLAGS="$CFLAGS -g" CFLAGS="$CFLAGS -g"
: ${HAVE_CAN_OTWO=0} ${HAVE_CAN_OPTIMISE=0} : "${HAVE_CAN_OTWO=0}${HAVE_CAN_OPTIMISE=0}"
;; ;;
esac esac
vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS" vv '|' "$CC $CFLAGS $CPPFLAGS $LDFLAGS $NOWARN -V conftest.c $LIBS"
@ -1258,7 +1259,7 @@ test $ct = unknown || HAVE_COMPILER_KNOWN=1
if ac_ifcpp 'if 0' compiler_fails '' \ if ac_ifcpp 'if 0' compiler_fails '' \
'if the compiler does not fail correctly'; then 'if the compiler does not fail correctly'; then
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
: ${HAVE_CAN_DELEXE=x} : "${HAVE_CAN_DELEXE=x}"
case $ct in case $ct in
dec) dec)
CFLAGS="$CFLAGS ${ccpl}-non_shared" CFLAGS="$CFLAGS ${ccpl}-non_shared"
@ -1620,8 +1621,8 @@ phase=x
# #
if ac_ifcpp 'ifdef MKSH_SMALL' isset_MKSH_SMALL '' \ if ac_ifcpp 'ifdef MKSH_SMALL' isset_MKSH_SMALL '' \
"if a reduced-feature mksh is requested"; then "if a reduced-feature mksh is requested"; then
: ${HAVE_NICE=0} : "${HAVE_NICE=0}"
: ${HAVE_PERSISTENT_HISTORY=0} : "${HAVE_PERSISTENT_HISTORY=0}"
check_categories="$check_categories smksh" check_categories="$check_categories smksh"
HAVE_ISSET_MKSH_CONSERVATIVE_FDS=1 # from sh.h HAVE_ISSET_MKSH_CONSERVATIVE_FDS=1 # from sh.h
fi fi
@ -1635,7 +1636,7 @@ ac_ifcpp 'ifdef MKSH_NOPROSPECTOFWORK' isset_MKSH_NOPROSPECTOFWORK '' \
"if mksh will be built without job signals" && \ "if mksh will be built without job signals" && \
check_categories="$check_categories arge nojsig" check_categories="$check_categories arge nojsig"
ac_ifcpp 'ifdef MKSH_ASSUME_UTF8' isset_MKSH_ASSUME_UTF8 '' \ ac_ifcpp 'ifdef MKSH_ASSUME_UTF8' isset_MKSH_ASSUME_UTF8 '' \
'if the default UTF-8 mode is specified' && : ${HAVE_SETLOCALE_CTYPE=0} 'if the default UTF-8 mode is specified' && : "${HAVE_SETLOCALE_CTYPE=0}"
ac_ifcpp 'ifdef MKSH_CONSERVATIVE_FDS' isset_MKSH_CONSERVATIVE_FDS '' \ ac_ifcpp 'ifdef MKSH_CONSERVATIVE_FDS' isset_MKSH_CONSERVATIVE_FDS '' \
'if traditional/conservative fd use is requested' && \ 'if traditional/conservative fd use is requested' && \
check_categories="$check_categories convfds" check_categories="$check_categories convfds"

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.700 2015/07/09 19:28:18 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.701 2015/07/09 20:11:45 tg Exp $
# -*- mode: sh -*- # -*- mode: sh -*-
#- #-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -3555,7 +3555,6 @@ name: history-ed-3-old
description: description:
Newly created multi line commands show up as single command Newly created multi line commands show up as single command
in history. in history.
(NOTE: adjusted for COMPLEX HISTORY compile time option)
(ksh88 fails 'cause it lists the fc command) (ksh88 fails 'cause it lists the fc command)
category: stdout-ed category: stdout-ed
need-ctty: yes need-ctty: yes
@ -5019,8 +5018,8 @@ description:
need to be moved out of the switch to before findcom() is need to be moved out of the switch to before findcom() is
called - I don't know what this will break. called - I don't know what this will break.
stdin: stdin:
: ${PWD:-`pwd 2> /dev/null`} : "${PWD:-`pwd 2> /dev/null`}"
: ${PWD:?"PWD not set - can't do test"} : "${PWD:?"PWD not set - can't do test"}"
mkdir Y mkdir Y
cat > Y/xxxscript << EOF cat > Y/xxxscript << EOF
#!/bin/sh #!/bin/sh