Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
set +r
so that it cannot unset the restricted option
The ksh man page documents that the restricted option cannot be unset once it is set, which means `set +r` should be invalid. While this was true for `set +o restricted`, `set +r` was causing the restricted option to be unset. The fix for this problem comes from one of Solaris' patches, which adds an error check to prevent this behavior. Solaris' patch: https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/020-CR6919590.patch src/cmd/ksh93/sh/args.c: - Add an error check to stop `set +r` from unsetting the restricted option. src/cmd/ksh93/tests/restricted.sh: - Add two regression tests to make sure the restricted option cannot be unset. (cherry picked from commit bef4fee404d8e24b38fce66420c14a39ac4a123e)
- Loading branch information