fix comsub inside parameter expansion in here-document; fix readline longjmp botch; posix change for unset non-identifier; posix change for double quotes inside backquote comsub in here-document; add missing posix pieces to umask builtin

This commit is contained in:
Chet Ramey
2022-12-19 09:38:15 -05:00
parent 49918d90cd
commit c4a2e37470
26 changed files with 360 additions and 100 deletions
+14 -1
View File
@@ -278,4 +278,17 @@ type
+ command -p -- command -v type
type
+ set +x
./builtins.tests: line 284: exit: status: numeric argument required
u=rw,g=rx,o=rx
u=r,g=rx,o=rx
u=rwx,g=rwx,o=
u=rw,g=wx,o=rx
u=rx,g=rx,o=rx
u=rwx,g=rx,o=rwx
u=rwx,g=rwx,o=rx
u=rx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rwx,o=rwx
u=rwx,g=rwx,o=rwx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=rx
./builtins.tests: line 287: exit: status: numeric argument required
+4 -1
View File
@@ -87,7 +87,7 @@ BVAR=xxx eval echo $AVAR
unset -v AVAR BVAR
# test umask
# basic umask tests
mask=$(umask)
umask 022
umask
@@ -280,6 +280,9 @@ ${THIS_SH} ./builtins6.sub
# test behavior of command builtin after changing it to a pseudo-keyword
${THIS_SH} ./builtins7.sub
# POSIX complete symbolic umask tests
${THIS_SH} ./builtins8.sub
# this must be last -- it is a fatal error
exit status
+54
View File
@@ -0,0 +1,54 @@
umask 022
umask u=r+w
umask -S
umask 022
umask u=r-w
umask -S
umask 022
umask g+u,o+rwx-u
umask -S
umask 022
umask u=r+w,g=wx,o+xr
umask -S
umask 022
umask u+w=r+x
umask -S
umask 022
umask o=u
umask -S
umask 022
umask g=u
umask -S
umask 022
umask u=rwx,u-w
umask -S
umask 022
umask u=xwr
umask -S
umask 022
umask +xwr
umask -S
umask 022
umask a+xwr
umask -S
umask 022
umask +xr
umask -S
umask 022
umask a+xr
umask -S
+5
View File
@@ -76,6 +76,11 @@ echo $(echo $( echo nested )
)
)
BUILDDIR=/builds/test
read << EOC
Dir: ${BUILDDIR#<(echo a)/}
EOC
${THIS_SH} ./comsub1.sub
${THIS_SH} ./comsub2.sub
${THIS_SH} ./comsub3.sub
+1
View File
@@ -76,6 +76,7 @@ match control-a 2
match control-a 3
match control-a 4
match control-a 5
./cond-regexp2.sub: line 18: [[: invalid regular expression `[\.'
ok 1
ok 2
ok 3
+7 -2
View File
@@ -48,7 +48,7 @@ hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
./errors.tests: line 157: umask: `:': invalid symbolic mode operator
./errors.tests: line 160: umask: -i: invalid option
umask: usage: umask [-p] [-S] [mode]
./errors.tests: line 164: umask: `u': invalid symbolic mode character
./errors.tests: line 164: umask: `p': invalid symbolic mode character
./errors.tests: line 173: VAR: readonly variable
./errors.tests: line 176: declare: VAR: readonly variable
./errors.tests: line 177: declare: VAR: readonly variable
@@ -210,4 +210,9 @@ DEBUG
bash: line 1: return: can only `return' from a function or sourced script
after return
bash: line 1: return: can only `return' from a function or sourced script
./errors.tests: line 305: `!!': not a valid identifier
sh: line 1: unset: a: cannot unset: readonly variable
sh: line 1: unset: `a-b': not a valid identifier
sh: line 1: /nosuchfile: No such file or directory
sh: line 1: trap: SIGNOSIG: invalid signal specification
after trap
./errors.tests: line 316: `!!': not a valid identifier
+12 -1
View File
@@ -161,7 +161,7 @@ umask -i
# bad assignments shouldn't change the umask
mask=$(umask)
umask g=u
umask g=p
mask2=$(umask)
if [ "$mask" != "$mask2" ]; then
echo "umask errors change process umask"
@@ -297,6 +297,17 @@ ${THIS_SH} ./errors9.sub
${THIS_SH} -c 'return ; echo after return' bash
${THIS_SH} -o posix -c 'return ; echo after return' bash
# various posix-mode special builtin fatal (or not) errors
# posix says unsetting readonly variables is a fatal error
${THIS_SH} -o posix -c 'readonly a=a ; unset -v a; echo after unset 1' sh
# the same with non-identifiers
${THIS_SH} -o posix -c 'unset -v a-b; echo after unset 2' sh
# and sourcing a non-existent file is fatal too
${THIS_SH} -o posix -c '. /nosuchfile ; echo after source' sh
# but trap specifying a bad signal nunber is non-fatal
${THIS_SH} -o posix -c 'trap "echo bad" SIGNOSIG; echo after trap' sh
# this must be last!
# in posix mode, a function name must be a valid identifier
# this can't go in posix2.tests, since it causes the shell to exit