Commit Graph

97 Commits (master)

Author SHA1 Message Date
Stephane Chazelas f1e7481b86 45837: fix process group restoration upon exit 3 months ago
Jun-ichi Takimoto f8d93888a8 50851: restore typtab when necessary
inittyptab() must be called when returning from a function with
"setopt localoptions MULTIBYTE|BANGHIST|SHSTDIN", and also in
function dosetopt() when setting these options (via $options, for
example). We intentionally did not take account of the options
EMACS/VI because these options are obsolete and their use is
not recommended.
2 years ago
Jun-ichi Takimoto dd51ffa5b4 49422: improve support of --disable-dynamic-nss
see also 49392 (Vincent) and 49412 (Axel)
3 years ago
Bart Schaefer 82ff9f24f1 48560: add TYPESET_TO_UNSET option to remove initialization of parameters
Changes typeset such that ${newparam-notset} yields "notset" and
"typeset -p newparam" does not show an assignment to the parameter.  This
is similar to the default behavior of bash and ksh, with minor differences
in typeset output.

Also add tests for some POSIX incompatibilities plus minor changes for test
harness robustness.
3 years ago
Bart Schaefer 408a830483 47913: implement CASE_PATHS option to make NO_CASE_GLOB more sensible 3 years ago
Peter Stephenson 3df604a4be 46026: Add CLOBBER_EMPTY option. 4 years ago
Mikael Magnusson 8923d2a618 Add SHORT_REPEAT option 4 years ago
dana 4ce66857b7 Clean up error-message white space 4 years ago
dana 26d02efa7a Improve PRIVILEGED fixes (again)
* Pass RGID instead of passwd GID to initgroups()

* Clean up #ifdefs, avoid unnecessary checks

* Flatten conditions
4 years ago
Daniel Shahaf 8250c5c168 Improve PRIVILEGED fixes
- Fix retval handling in bin_setopt()

- Don't skip_setuid / skip_setgid.  It's not our place to optimize away noops
  (that might not even _be_ noops; they might change the saved uid…).

- Remove HAVE_* guard checks around functions that are used unguarded elsewhere.

- Use bsd-setres_id.c from OpenSSH to provide setresuid() / setresgid()
  everywhere, and thus simplify the ifdef soup.  Fix some preëxisting
  bugs in the macro definitions of setuid() (do we still need that one?).

- Fix zwarning() format codes for variadic arguments type safety

- Restored a comment from HEAD

- Fix failure modes around initgroups()

- Compared privilege restoration code with OpenSSH's permanently_drop_uid() and
  updated as needed

- Add E01 PRIVILEGED sanity checks
4 years ago
Sam Foxman 24e993db62 Drop privileges securely 4 years ago
dana 78fb8aaccf 44198: Add cd_silent option to suppress all cd output 5 years ago
Peter Stephenson f37c181b29 43008: Improve code to remove privileges.
Remove warnings of unused values as we always check the finally
result later.

Put segid before setuid as the setgid could fail if UID
no longer privileged.
6 years ago
Peter Stephenson 5f6a52c06c 42156: new CHECK_RUNNING_JOBS option demanded by bash groupies
Also new job options.

Also suppress debug error if rows or columns are reported as zero as
this is normal without a physical terminal.
6 years ago
Barton E. Schaefer e51c9c17af 40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant. 7 years ago
Peter Stephenson c861b17bbf 40391: Add WARN_NESTED_VAR option and functions -W.
These are companions to WARN_CREATED_GLOBAL, warning when a variable
from an enclosing scope is altered.
7 years ago
Peter Stephenson bb218704d2 40306 with doc tweaks: Change behaviour expanding alias in () function definition.
Now an error unless the () is part of the same error as the name.
Add ALIAS_FUNC_DEF option to allow it again.
7 years ago
Barton E. Schaefer 6756870a92 38039: POSIXy behavior for "set +o" 8 years ago
Barton E. Schaefer 7611e78ad1 unposted (cf. 37387): emulate turns off WARN_CREATE_GLOBAL 9 years ago
Peter Stephenson ba36967b57 37038: add -l option to emulate to list options in emulations 9 years ago
Peter Stephenson 58f4cccb1f 37022: add GLOB_STAR_SHORT option to abbreviate ** and *** 9 years ago
Peter Stephenson 7708849b21 35655: APPEND_CREATE option for POSIX copmatible NO_CLOBBER 9 years ago
Peter Stephenson 39b28980f3 various posts: Implement assignment parsing for typeset.
Typeset assignments now work like raw assignments except
for no "+=" and no GLOB_ASSIGN.

Documented in typeset builtin doc and mentioned in release notes.

Tests to ensure basic sanity.

Enabled by default, can be turned off by "disable -r" with typeset
family of commands.
9 years ago
Peter Stephenson 40446a9827 35416: Turn on MULTIBYTE in all emulations.
This now includes sh.
9 years ago
Jérémie Roquet 52d37d7ff4 Take more care with errors from setuid().
This is to ensure the user is aware of errors unsetting the
PRIVELEGED option.
10 years ago
Peter Stephenson b5198b10a1 32768 with further modifications: LOCAL_LOOPS option. 10 years ago
Peter Stephenson 7f6dc0fe8e 32682 with tweaks: Add INC_APPEND_HISTORY_TIME.
Revert INC_APPEND_HISTORY behaviour.
10 years ago
Barton E. Schaefer 19f3161e51 32634: add POSIX_ARGZERO option 10 years ago
Peter Stephenson 5236425865 users:18023: Add PIPEFAIL option 11 years ago
Peter Stephenson fdf2867e5f 31444: Basic code for enable/disable -p 11 years ago
Peter Stephenson 3def943d04 users/17665: add FORCE_FLOAT option 11 years ago
Peter Stephenson 7c56d77184 30789: Add CONTINUE_ON_ERROR for old behaviour.
New behaviour is for scripts to exit on error instead of returning
to top level and executing the next command.
12 years ago
Peter Stephenson 4b86cc48f7 30726: make shell options passed to emulate stick along with the emulation 12 years ago
Peter Stephenson 4e2cdd7956 30722: fix some cases where emulations or options were not propagated properly
from the emulate command
12 years ago
Peter Stephenson 76ac7bf742 30716: make IGNORECLOSEBRACES an emulation option 12 years ago
Peter Stephenson 6f3ff6b653 30633: "functions -T" only traces marked function, not called functions 12 years ago
Bart Schaefer fa8a0e241c 30320: "emulate" accepts invocation-time flags; other small doc tweaks. 12 years ago
Peter Stephenson 7614be7fe1 30303: emulate inside function marked for execution tracing enables xtrace 12 years ago
Peter Stephenson c214b86e94 30101: add HASH_EXECUTABLES_ONLY option 13 years ago
Peter Stephenson e3182c18de 29955++: IGNORE_CLOSE_BRACES option 13 years ago
Peter Stephenson cc9bc2dd0b 28424: new POSIX_STRINGS option 14 years ago
Peter Stephenson 66f32a80dc 28308/28310: HIST_LEX_WORDS, check for quick history read 14 years ago
Peter Stephenson ade705cf5b 28253: document -h argument to atribute commands 14 years ago
Peter Stephenson 53745d8df0 27793 and follow ups: add PATH_SCRIPT option to find script using $PATH 14 years ago
Peter Stephenson 06b7029aa8 27638, based on Frank Terbeck, 27633: SOURCETRACE option 15 years ago
Peter Stephenson 036cb0ce95 Joakim Rosqvist: 27591 as modified in 27594:
KEYBOARD_HACK variable
15 years ago
Peter Stephenson 606cfb5a5e 27167: add POSIX_CD option to test "." after CDPATH 15 years ago
Peter Stephenson 73be7ee553 27106: reset status on command that expands to empty
27122: add POSIX_JOBS option
15 years ago
Peter Stephenson b31ca21b46 27100: Allow MONITOR option in non-interactive shells for testing. 15 years ago
Peter Stephenson 8e25f4449f 26675: add POSIX_ALIASES option 15 years ago