1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 15:01:21 +02:00
Commit Graph

11129 Commits

Author SHA1 Message Date
Jun-ichi Takimoto
fe516fccb4 45492: skip test added by users/24633 on Cygwin 2020-02-27 16:08:13 +09:00
Marc
f7c6a0008b 45488: COMP_WORDS for bash need "$@"-style quoting 2020-02-25 09:55:28 +00:00
Peter Stephenson
a6a1b28b98 45487: Missing mod_export declarations for AIX 2020-02-24 10:55:48 +00:00
Daniel Shahaf
50df0e0bb9 45447: Complete vcs_info_hookadd and vcs_info_hookdel. Expose _vcs_info_hooks as a top-level helper function. 2020-02-19 10:18:30 +00:00
Chris Down
69c247de2f 45463: test: kill: Document why we use SIGURG
See discussion in workers/45460.
2020-02-18 19:35:18 +00:00
Chris Down
5c55b3fb50 45453: builtins: kill: Do not signal current process group when pid is empty
The following case was encountered in the wild:

    % zsh; echo "$?"
    % trap 'exit 5' TERM
    % kill ''
    5

This behaviour seems more likely to be the result of bugs in programs
(e.g. `kill -9 "$unsetvar") rather than being desirable
behaviour to me.  It also seems unintentional judging by the code and
documentation, since it comes about as a result of the fact that:

- `isanum` returns true for empty strings (since an empty string
  technically only consists of digits and minuses...);
- `atoi`, when passed a pointer to an invalid number, returns 0;
- `kill(0, signal)` sends the signal in question to all processes in the
  current process group.

There are (at least) two ways to solve this issue:

1. Add special handling to `kill` to avoid this case. See this patch[0]
   for a version that does that.
2. Change how isanum behaves. Since the only two call sites that use it
   both seem like they should handle the case where the input char array
   is empty, that seems like a reasonable overall change to me.[1]

After this patch:

    % trap 'exit 5' TERM
    % kill ''
    kill: illegal pid:

The regression test for `kill` without a sigspec is also included in
this commit, as previously it's not possible to test it trivially as it
would still kill the test runner in expected-to-fail mode; see
discussion in workers/45449.

0: workers/45426: https://www.zsh.org/mla/workers/2020/msg00251.html
1: The other call site using isanum() is the fg builtin, but in that
   case we just fail later since we can't find any job named '', so no
   big deal either way. It's the kill case which is more concerning.
2020-02-18 12:59:53 +00:00
Chris Down
59258252b5 45452: builtins: kill: Add kill '' regression test with explicit sigspec
The version without a sigspec can't be added yet because it would still
kill the test runner even in expected-to-fail mode; see workers/45449
for discussion. For the same reason, we use a signal which is non-fatal
by default and unlikely to be sent by someone else, SIGURG, to do the
expected-to-fail case prior to the fix.
2020-02-18 12:59:52 +00:00
Chris Down
cb5d8bfe86 45451: builtins: kill: Add basic test suite
This is not totally comprehensive, but at least it's a start for the
core functionality. In the next commits, we'll also use this base to add
some regression tests.
2020-02-18 12:59:51 +00:00
brian m. carlson
5126096370 github #48/0002: vcs_info git: properly detect bare repositories
We currently detect Git repositories by finding the top level of the
working tree, and if we fail to detect it, assume that we're not in a
repository.  However, there's a case we don't consider: a bare
repository.

Let's detect if the user is in a bare repository by checking if gitdir
is set, and if so, using that if there is no working tree.  We now
detect bare Git repositories with vcs_info, as expected.
2020-02-17 10:03:08 +00:00
brian m. carlson
bacad96523 github #48/0001: vcs_info git: avoid warnings in bare repositories
Git 2.25 introduced a change to how git rev-parse --show-toplevel
behaves.  Traditionally, it succeeded with no output if the user was
in a bare repository.  Now it dies, printing an error to standard error.
Consequently, when the user is in a bare repository with a newer Git,
vcs_info prints noisily to standard error.

While this is functionally harmless, it is annoying for the shell to
print messages from Git every time the prompt is printed, so let's
silence the error message.
2020-02-17 10:02:27 +00:00
dana
459e2be810 unposted: Post-release version bump 2020-02-14 16:11:03 -06:00
dana
77d203f3fb unposted: Release 5.8 zsh-5.8 2020-02-14 16:08:55 -06:00
dana
4bec892059 CVE-2019-20044: Update change log for preceding commits 2020-02-14 16:08:29 -06:00
dana
048f40b68b Update NEWS/README 2020-02-14 16:06:58 -06:00
dana
b15bd4aa59 Add unsetopt/PRIVILEGED tests 2020-02-14 16:06:58 -06:00
dana
4ce66857b7 Clean up error-message white space 2020-02-14 16:06:57 -06:00
dana
26d02efa7a Improve PRIVILEGED fixes (again)
* Pass RGID instead of passwd GID to initgroups()

* Clean up #ifdefs, avoid unnecessary checks

* Flatten conditions
2020-02-14 16:06:57 -06:00
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
2020-02-14 16:06:57 -06:00
Sam Foxman
24e993db62 Drop privileges securely 2020-02-14 16:06:57 -06:00
dana
e89060a377 unposted: V01zmodload: Fix failing test from workers/45385 2020-02-14 15:55:52 -06:00
dana
dd523255cc 45423: _su: Improve arg handling, shell look-ups
Differences from ML post:

* Properly fix escaping issue with $usr (needs unescaped first)

* Make $shell emptiness check easier to read (per feedback)
2020-02-14 09:42:12 -06:00
dana
8037462895 unposted: _zip: Recognise '--' 2020-02-07 14:05:48 -06:00
Daniel Shahaf
699dfdd0ea 45385: Add a test for 'zmodload -Fa' preemptively disabling ("blacklisting"?) features. 2020-02-07 12:44:53 +00:00
dana
643de93164 unposted: Test release: 5.7.1-test-3 zsh-5.7.1-test-3 2020-02-06 14:01:53 -06:00
Roman Perepelitsa
754fdc6580 zsh/system: Fix infinite loop in sysread 2020-02-06 13:42:32 -06:00
Martin von Wittich
1f238665f6 _diff_options: Restore -w completion lost in workers/43351 2020-02-06 13:24:00 -06:00
Daniel Shahaf
8a12bd81aa unposted: Fix ChangeLog typo. 2020-02-06 05:55:05 +00:00
Daniel Shahaf
3bcf9641eb 45368: Add tests for workers/45367's issue about double slashes in 'cd -P' and /home/daniel/in/zsh. 2020-02-03 07:09:30 +00:00
Peter Stephenson
e01223a26c 45373: Fix ERR_EXIT bug in else branch of if.
The flags need resetting for this branch otherwise e.g. command
substitution with non-zero status doesn't cause exit.
2020-02-02 18:05:47 +00:00
Daniel Shahaf
7a9467e430 45372: Record a symlink loop bug involving :P 2020-02-02 07:36:41 +00:00
WGH
e71ba9704f 45365: _git: Fix __git_recent_branches for the case when a commit has an empty message 2020-02-02 07:32:14 +00:00
Daniel Shahaf
581585dfc6 45343: Queue signals around arithmetic evaluations
The queueing added in execarith() in 45083 is reverted since the callee
does this now.
2020-01-29 09:02:49 +00:00
Daniel Shahaf
8dab5bc037 45344: Document where third-party completion functions should be installed. 2020-01-29 09:02:34 +00:00
Daniel Shahaf
a06143bb30 45345: internal: ztst.vim: Fix highlighting of zsh comments in test payload 2020-01-28 09:24:34 +00:00
Daniel Shahaf
3511169731 unposted: internal: Add some comments and fix indentation. No functional change. 2020-01-26 03:46:00 +00:00
Daniel Shahaf
5e843a3721 45340: internal: Document the difference between paramtab and realparamtab. 2020-01-23 03:21:36 +00:00
Eitan Adler
e626f57613 45332: _git: add completion for git-version
Signed-off-by: Eitan Adler <lists@eitanadler.com>
2020-01-19 23:32:37 +00:00
Mikael Magnusson
387247864e _brace_parameter: add missing \ 2020-01-19 16:11:14 +01:00
Daniel Shahaf
28e11ac60b 45305: Add an XFail test: The exec-last-command optimization is applied to try/always. 2020-01-16 18:21:11 +00:00
Daniel Shahaf
0a7bfc0bd2 45307: zstyle docs: Unoverload a placeholder variable name.
Use 'pattern' to refer to things matched against contexts and 'metapattern'
to refer to things matched against patterns.
2020-01-16 18:18:17 +00:00
Daniel Shahaf
6f263b5e89 45306: zstyle docs: Introduce the first synopsis in the same way as all others: with an item()(). 2020-01-16 18:18:14 +00:00
Daniel Shahaf
490478378f unposted: docs: Fix a cross-reference. 2020-01-16 16:32:39 +00:00
Daniel Shahaf
c7bc62aa06 45287: zshexpn: Describe parameter elision and add some introductory prose 2020-01-15 22:35:09 +00:00
Daniel Shahaf
faa476a4ed 45302: bin_umask(): Queue signals around umask().
Otherwise, a signal handler might create files while the temporary umask
is in effect.
2020-01-15 19:49:45 +00:00
Daniel Shahaf
610b4b3028 users/24656: docs: Add an example of setting and querying zstyles 2020-01-14 17:42:36 +00:00
Peter Stephenson
8406a0d38e users/24659: Cross-ref doc for matchers. 2020-01-14 14:00:03 +00:00
dana
62a1e37ccc 45296: D02glob: Clean up after test from users/24633 2020-01-13 17:43:51 -06:00
Daniel Shahaf
9f8c369ccd 45290: New helper script for listing XFail tests. 2020-01-13 22:48:55 +00:00
Daniel Shahaf
0681be600c users/24633: Add an xfail test for users/24619. 2020-01-12 22:14:10 +00:00
Oliver Kiddle
06a9af4f59 unposted: additional typo fix 2020-01-11 17:41:14 +01:00