[-]
[+]
|
Changed |
_service:tar_git:zsh.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:zsh.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfishos-chum/zsh-packaging.git</param>
<param name="branch">master</param>
- <param name="revision">5.8.1</param>
+ <param name="revision">v5.8.1-2</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/ChangeLog
^
|
@@ -1,3 +1,42 @@
+2022-02-12 dana <dana@dana.is>
+
+ * unposted: Config/version.mk, Etc/FAQ.yo, README: Update
+ for 5.8.1
+
+2022-01-27 dana <dana@dana.is>
+
+ * Jun-ichi Takimoto: unposted: Src/input.c: add 'static' to
+ shinsavestack
+
+ * Peter Stephenson: 49290: Src/init.c, Src/input.c: Replace
+ stdio for buffered shell input to avoid memory management
+ interacting with signal handlers.
+
+ * Jun-ichi Takimoto: 49377: Src/Zle/zle_keymap.c,
+ Test/X03zlebindkey.ztst: fix segfault by 'bindkey -d' with
+ reordered keymapnamtab
+
+ * Jun-ichi Takimoto: 47560: configure.ac, aczsh.m4: add necessary
+ includes or prototypes for the tests in configure (fix errors in
+ macOS 11)
+
+ * unposted: Completion/Unix/Command/_git: Fix copy/paste error
+ in earlier commit that broke `git stash drop`
+
+ * Marc Cornellà: security/82 (tweaked):
+ Functions/VCS_Info/VCS_INFO_formats: Fix typo in
+ hook_com[base-name_orig] assignment
+
+ * CVE-2021-45444: NEWS, README: Document preceding two changes
+
+ * Marc Cornellà: security/89:
+ Etc/CVE-2021-45444-VCS_Info-workaround.patch: Add patch which
+ can optionally be used to work around recursive PROMPT_SUBST
+ issue in VCS_Info
+
+ * Oliver Kiddle: security/41: Src/prompt.c: Prevent recursive
+ PROMPT_SUBST
+
2020-02-14 dana <dana@dana.is>
* unposted: Config/version.mk: Update for 5.8
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Completion/Unix/Command/_git
^
|
@@ -1809,7 +1809,7 @@
_nothing
;;
(drop)
- _arguments -S $endopt \_git-notes
+ _arguments -S $endopt \
'(-q --quiet)'{-q,--quiet}'[suppress all output]' \
':: :__git_stashes' && ret=0
;;
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Config/version.mk
^
|
@@ -27,5 +27,5 @@
# This must also serve as a shell script, so do not add spaces around the
# `=' signs.
-VERSION=5.8
-VERSION_DATE='February 14, 2020'
+VERSION=5.8.1
+VERSION_DATE='February 12, 2022'
|
[-]
[+]
|
Added |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Etc/CVE-2021-45444-VCS_Info-workaround.patch
^
|
@@ -0,0 +1,98 @@
+From 972887bbe5eb6a00e5f0e73781d6d73bfdcafb93 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc=20Cornell=C3=A0?= <hello@mcornella.com>
+Date: Mon, 24 Jan 2022 09:43:28 +0100
+Subject: [PATCH] security/89: Partially work around CVE-2021-45444 in VCS_Info
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This patch is a partial, VCS_Info-specific work-around for CVE-2021-45444,
+which is mitigated in the shell itself in 5.8.1 and later versions. It is
+offered for users who are concerned about an exploit but are unable to update
+their binaries to receive the complete fix.
+
+The patch works around the vulnerability by pre-escaping values substituted
+into format strings in VCS_Info. Please note that this may break some user
+configurations that rely on those values being un-escaped (which is why it was
+not included directly in 5.8.1). It may be possible to limit this breakage by
+adjusting exactly which ones are pre-escaped, but of course this may leave
+them vulnerable again.
+
+If applying the patch to the file system is inconvenient or not possible, the
+following script can be used to idempotently patch the relevant function
+running in memory (and thus must be re-run when the shell is restarted):
+
+
+# Impacted versions go from v5.0.3 to v5.8 (v5.8.1 is the first patched version)
+autoload -Uz is-at-least
+if is-at-least 5.8.1 || ! is-at-least 5.0.3; then
+ return
+fi
+
+# Quote necessary $hook_com[<field>] items just before they are used
+# in the line "VCS_INFO_hook 'post-backend'" of the VCS_INFO_formats
+# function, where <field> is:
+#
+# base: the full path of the repository's root directory.
+# base-name: the name of the repository's root directory.
+# branch: the name of the currently checked out branch.
+# revision: an identifier of the currently checked out revision.
+# subdir: the path of the current directory relative to the
+# repository's root directory.
+# misc: a string that may contain anything the vcs_info backend wants.
+#
+# This patch %-quotes these fields previous to their use in vcs_info hooks and
+# the zformat call and, eventually, when they get expanded in the prompt.
+# It's important to quote these here, and not later after hooks have modified the
+# fields, because then we could be quoting % characters from valid prompt sequences,
+# like %F{color}, %B, etc.
+#
+# 32 │ hook_com[subdir]="$(VCS_INFO_reposub ${hook_com[base]})"
+# 33 │ hook_com[subdir_orig]="${hook_com[subdir]}"
+# 34 │
+# 35 + │ for tmp in base base-name branch misc revision subdir; do
+# 36 + │ hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"
+# 37 + │ done
+# 38 + │
+# 39 │ VCS_INFO_hook 'post-backend'
+#
+# This is especially important so that no command substitution is performed
+# due to malicious input as a consequence of CVE-2021-45444, which affects
+# zsh versions from 5.0.3 to 5.8.
+#
+autoload -Uz +X regexp-replace VCS_INFO_formats
+
+# We use $tmp here because it's already a local variable in VCS_INFO_formats
+typeset PATCH='for tmp (base base-name branch misc revision subdir) hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"'
+# Unique string to avoid reapplying the patch if this code gets called twice
+typeset PATCH_ID=vcs_info-patch-9b9840f2-91e5-4471-af84-9e9a0dc68c1b
+# Only patch the VCS_INFO_formats function if not already patched
+if [[ "$functions[VCS_INFO_formats]" != *$PATCH_ID* ]]; then
+ regexp-replace 'functions[VCS_INFO_formats]' \
+ "VCS_INFO_hook 'post-backend'" \
+ ': ${PATCH_ID}; ${PATCH}; ${MATCH}'
+fi
+unset PATCH PATCH_ID
+
+
+---
+ Functions/VCS_Info/VCS_INFO_formats | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats
+index e0e1dc738..4d88e28b6 100644
+--- a/Functions/VCS_Info/VCS_INFO_formats
++++ b/Functions/VCS_Info/VCS_INFO_formats
+@@ -32,6 +32,10 @@ hook_com[base-name_orig]="${hook_com[base_name]}"
+ hook_com[subdir]="$(VCS_INFO_reposub ${hook_com[base]})"
+ hook_com[subdir_orig]="${hook_com[subdir]}"
+
++for tmp in base base-name branch misc revision subdir; do
++ hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"
++done
++
+ VCS_INFO_hook 'post-backend'
+
+ ## description (for backend authors):
+--
+2.34.1
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Etc/FAQ.yo
^
|
@@ -308,7 +308,7 @@
sect(What's the latest version?)
- Zsh 5.8 is the latest production version. For details of all the
+ Zsh 5.8.1 is the latest production version. For details of all the
changes, see the NEWS file in the source distribution.
A beta of the next version is sometimes available. Development of zsh is
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Functions/VCS_Info/VCS_INFO_formats
^
|
@@ -28,7 +28,7 @@
vcs_orig "${vcs}"
)
hook_com[base-name]="${${hook_com[base]}:t}"
-hook_com[base-name_orig]="${hook_com[base_name]}"
+hook_com[base-name_orig]="${hook_com[base-name]}"
hook_com[subdir]="$(VCS_INFO_reposub ${hook_com[base]})"
hook_com[subdir_orig]="${hook_com[subdir]}"
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/NEWS
^
|
@@ -4,6 +4,26 @@
Note also the list of incompatibilities in the README file.
+Changes since 5.8
+-----------------
+
+CVE-2021-45444: Some prompt expansion sequences, such as %F, support
+'arguments' which are themselves expanded in case they contain colour
+values, etc. This additional expansion would trigger PROMPT_SUBST
+evaluation, if enabled. This could be abused to execute code the user
+didn't expect. e.g., given a certain prompt configuration, an attacker
+could trick a user into executing arbitrary code by having them check
+out a Git branch with a specially crafted name.
+
+This is fixed in the shell itself by no longer performing PROMPT_SUBST
+evaluation on these prompt-expansion arguments.
+
+Users who are concerned about an exploit but unable to update their
+binaries may apply the partial work-around described in the file
+Etc/CVE-2021-45444-VCS_Info-workaround.patch included with the shell
+source. [ Reported by RyotaK <security@ryotak.me>. Additional thanks to
+Marc Cornellà <hello@mcornella.com>. ]
+
Changes since 5.7.1-test-3
--------------------------
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/README
^
|
@@ -5,12 +5,11 @@
Version
-------
-This is version 5.8 of the shell. This is a security and feature release.
-There are a few visible improvements since 5.7, as well as many bugfixes.
+This is version 5.8.1 of the shell. This is a security and bugfix release.
All zsh installations are encouraged to upgrade as soon as possible.
Note in particular the changes highlighted under "Incompatibilities since
-5.7.1" below. See NEWS for more information.
+5.8" below. See NEWS for more information.
Installing Zsh
--------------
@@ -31,6 +30,12 @@
file FEATURES, and for the latest changes see NEWS. For more
details, see the documentation.
+Incompatibilities since 5.8
+---------------------------
+
+PROMPT_SUBST expansion is no longer performed on arguments to prompt-
+expansion sequences such as %F.
+
Incompatibilities since 5.7.1
-----------------------------
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Src/Zle/zle_keymap.c
^
|
@@ -155,7 +155,7 @@
keymapnamtab = newhashtable(7, "keymapnamtab", NULL);
keymapnamtab->hash = hasher;
- keymapnamtab->emptytable = emptyhashtable;
+ keymapnamtab->emptytable = emptykeymapnamtab;
keymapnamtab->filltable = NULL;
keymapnamtab->cmpnodes = strcmp;
keymapnamtab->addnode = addhashnode;
@@ -178,6 +178,26 @@
return kmn;
}
+/**/
+static void
+emptykeymapnamtab(HashTable ht)
+{
+ struct hashnode *hn, *hp;
+ int i;
+
+ for (i = 0; i < ht->hsize; i++) {
+ for (hn = ht->nodes[i]; hn;) {
+ KeymapName kmn = (KeymapName) hn;
+ hp = hn->next;
+ zsfree(kmn->nam);
+ unrefkeymap(kmn->keymap);
+ zfree(kmn, sizeof(*kmn));
+ hn = hp;
+ }
+ ht->nodes[i] = NULL;
+ }
+ ht->ct = 0;
+}
/*
* Reference a keymap from a keymapname.
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Src/init.c
^
|
@@ -1222,7 +1222,7 @@
/*
* Finish setting up SHIN and its relatives.
*/
- bshin = SHIN ? fdopen(SHIN, "r") : stdin;
+ shinbufalloc();
if (isset(SHINSTDIN) && !SHIN && unset(INTERACTIVE)) {
#ifdef _IONBF
setvbuf(stdin, NULL, _IONBF, 0);
@@ -1377,9 +1377,9 @@
dosetopt(RESTRICTED, 1, 0, opts);
if (cmd) {
if (SHIN >= 10)
- fclose(bshin);
+ close(SHIN);
SHIN = movefd(open("/dev/null", O_RDONLY | O_NOCTTY));
- bshin = fdopen(SHIN, "r");
+ shinbufreset();
execstring(cmd, 0, 1, "cmdarg");
stopmsg = 1;
zexit((exit_pending || shell_exiting) ? exit_val : lastval, ZEXIT_NORMAL);
@@ -1402,7 +1402,6 @@
int tempfd = -1, fd, cj;
zlong oldlineno;
int oldshst, osubsh, oloops;
- FILE *obshin;
char *old_scriptname = scriptname, *us;
char *old_scriptfilename = scriptfilename;
unsigned char *ocs;
@@ -1419,7 +1418,6 @@
/* save the current shell state */
fd = SHIN; /* store the shell input fd */
- obshin = bshin; /* store file handle for buffered shell input */
osubsh = subsh; /* store whether we are in a subshell */
cj = thisjob; /* store our current job number */
oldlineno = lineno; /* store our current lineno */
@@ -1432,7 +1430,7 @@
if (!prog) {
SHIN = tempfd;
- bshin = fdopen(SHIN, "r");
+ shinbufsave();
}
subsh = 0;
lineno = 1;
@@ -1500,10 +1498,10 @@
if (prog)
freeeprog(prog);
else {
- fclose(bshin);
+ close(SHIN);
fdtable[SHIN] = FDT_UNUSED;
SHIN = fd; /* the shell input fd */
- bshin = obshin; /* file handle for buffered shell input */
+ shinbufrestore();
}
subsh = osubsh; /* whether we are in a subshell */
thisjob = cj; /* current job number */
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Src/input.c
^
|
@@ -80,11 +80,6 @@
/**/
int SHIN;
-/* buffered shell input for non-interactive shells */
-
-/**/
-FILE *bshin;
-
/* != 0 means we are reading input from a string */
/**/
@@ -129,7 +124,116 @@
static int instacksz = INSTACK_INITIAL;
-/* Read a line from bshin. Convert tokens and *
+/* Size of buffer for non-interactive command input */
+
+#define SHINBUFSIZE 8192
+
+/* Input buffer for non-interactive command input */
+static char *shinbuffer;
+
+/* Pointer into shinbuffer */
+static char *shinbufptr;
+
+/* End of contents read into shinbuffer */
+static char *shinbufendptr;
+
+/* Entry on SHIN buffer save stack */
+struct shinsaveentry {
+ /* Next entry on stack */
+ struct shinsaveentry *next;
+ /* Saved shinbuffer */
+ char *buffer;
+ /* Saved shinbufptr */
+ char *ptr;
+ /* Saved shinbufendptr */
+ char *endptr;
+};
+
+/* SHIN buffer save stack */
+static struct shinsaveentry *shinsavestack;
+
+/* Reset the input buffer for SHIN, discarding any pending input */
+
+/**/
+void
+shinbufreset(void)
+{
+ shinbufendptr = shinbufptr = shinbuffer;
+}
+
+/* Allocate a new shinbuffer
+ *
+ * Only called at shell initialisation and when saving on the stack.
+ */
+
+/**/
+void
+shinbufalloc(void)
+{
+ shinbuffer = zalloc(SHINBUFSIZE);
+ shinbufreset();
+}
+
+/* Save entry on SHIN buffer save stack */
+
+/**/
+void
+shinbufsave(void)
+{
+ struct shinsaveentry *entry =
+ (struct shinsaveentry *)zalloc(sizeof(struct shinsaveentry));
+
+ entry->next = shinsavestack;
+ entry->buffer = shinbuffer;
+ entry->ptr = shinbufptr;
+ entry->endptr = shinbufendptr;
+
+ shinsavestack = entry;
+
+ shinbufalloc();
+}
+
+/* Restore entry from SHIN buffer save stack */
+
+/**/
+void
+shinbufrestore(void)
+{
+ struct shinsaveentry *entry = shinsavestack;
+
+ zfree(shinbuffer, SHINBUFSIZE);
+
+ shinbuffer = entry->buffer;
+ shinbufptr = entry->ptr;
+ shinbufendptr = entry->endptr;
+
+ shinsavestack = entry->next;
+ zfree(entry, sizeof(struct shinsaveentry));
+}
+
+/* Get a character from SHIN, -1 if none available */
+
+/**/
+static int
+shingetchar(void)
+{
+ int nread;
+
+ if (shinbufptr < shinbufendptr)
+ return STOUC(*shinbufptr++);
+
+ shinbufreset();
+ do {
+ errno = 0;
+ nread = read(SHIN, shinbuffer, SHINBUFSIZE);
+ } while (nread < 0 && errno == EINTR);
+ if (nread <= 0)
+ return -1;
+ shinbufendptr = shinbuffer + nread;
+ return STOUC(*shinbufptr++);
+}
+
+/* Read a line from SHIN. Convert tokens and *
* null characters to Meta c^32 character pairs. */
/**/
@@ -147,11 +251,7 @@
winch_unblock();
dont_queue_signals();
for (;;) {
- /* Can't fgets() here because we need to accept '\0' bytes */
- do {
- errno = 0;
- c = fgetc(bshin);
- } while (c < 0 && errno == EINTR);
+ c = shingetchar();
if (c < 0 || c == '\n') {
winch_block();
restore_queue_signals(q);
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Src/prompt.c
^
|
@@ -244,6 +244,12 @@
bv->fm += 2; /* skip over F{ */
if ((ep = strchr(bv->fm, '}'))) {
char oc = *ep, *col, *coll;
+ int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG];
+ int opp = opts[PROMPTPERCENT];
+
+ opts[PROMPTPERCENT] = 1;
+ opts[PROMPTSUBST] = opts[PROMPTBANG] = 0;
+
*ep = '\0';
/* expand the contents of the argument so you can use
* %v for example */
@@ -252,6 +258,10 @@
arg = match_colour((const char **)&coll, is_fg, 0);
free(col);
bv->fm = ep;
+
+ opts[PROMPTSUBST] = ops;
+ opts[PROMPTBANG] = opb;
+ opts[PROMPTPERCENT] = opp;
} else {
arg = match_colour((const char **)&bv->fm, is_fg, 0);
if (*bv->fm != '}')
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/Test/X03zlebindkey.ztst
^
|
@@ -143,3 +143,18 @@
>CURSOR: 18
>BUFFER: echo $(( ##x ) ##x ) y
>CURSOR: 22
+
+ bindkey -d
+ for name in a b c d e; bindkey -N $name
+ bindkey -d
+ bindkey -l
+0:delete all keymaps after expanding keymapnamtab
+>.safe
+>command
+>emacs
+>isearch
+>main
+>vicmd
+>viins
+>viopp
+>visual
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/aczsh.m4
^
|
@@ -118,6 +118,7 @@
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
AC_TRY_RUN([
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
@@ -199,6 +200,7 @@
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
AC_TRY_RUN([
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
@@ -274,6 +276,7 @@
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AC_FD_CC) &&
AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AC_FD_CC); then
AC_TRY_RUN([
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
@@ -343,6 +346,7 @@
save_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
AC_TRY_RUN([
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
@@ -416,6 +420,7 @@
save_ldflags=$LDFLAGS
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s"
AC_TRY_RUN([
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
@@ -483,6 +488,7 @@
if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AC_FD_CC) &&
AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AC_FD_CC); then
AC_TRY_RUN([
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
|
[-]
[+]
|
Changed |
_service:tar_git:zsh-5.8.1.tar.bz2/zsh/configure.ac
^
|
@@ -1394,6 +1394,10 @@
AC_CACHE_CHECK(if tgetent accepts NULL,
zsh_cv_func_tgetent_accepts_null,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <fcntl.h>
+#include <stdlib.h>
+int tgetent(char *, char *);
+char *tgetstr(char *, char **);
main()
{
char buf[4096];
@@ -1418,6 +1422,10 @@
AC_CACHE_CHECK(if tgetent returns 0 on success,
zsh_cv_func_tgetent_zero_success,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <fcntl.h>
+#include <stdlib.h>
+int tgetent(char *, char*);
+char *tgetstr(char *, char **);
main()
{
char buf[4096];
@@ -1855,6 +1863,7 @@
#include <sys/time.h>
#endif
#include <sys/resource.h>
+#include <stdlib.h>
main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
if test x$zsh_cv_rlim_t_is_longer = xyes; then
AC_CACHE_CHECK(if rlim_t is a quad,
@@ -1865,6 +1874,7 @@
#endif
#include <stdio.h>
#include <sys/resource.h>
+#include <stdlib.h>
main() {
struct rlimit r;
char buf[20];
@@ -1887,6 +1897,7 @@
#include <sys/time.h>
#endif
#include <sys/resource.h>
+#include <stdlib.h>
main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then
AC_DEFINE(RLIM_T_IS_UNSIGNED)
@@ -2258,6 +2269,9 @@
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
#include <signal.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/stat.h>
main()
{
char c;
@@ -2299,6 +2313,7 @@
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <fcntl.h>
+#include <stdlib.h>
main()
{
int ret;
@@ -2331,6 +2346,7 @@
#include <unistd.h>
#include <signal.h>
#include <errno.h>
+#include <stdlib.h>
main()
{
int pid = (getpid() + 10000) & 0xffffff;
@@ -2356,6 +2372,7 @@
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <signal.h>
#include <unistd.h>
+#include <stdlib.h>
int child=0;
void handler(sig)
int sig;
@@ -2407,6 +2424,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
+#include <stdlib.h>
main() {
int fd;
int ret;
@@ -2450,6 +2468,10 @@
zsh_cv_sys_getpwnam_faked,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <pwd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
main() {
struct passwd *pw1, *pw2;
char buf[1024], name[1024];
@@ -2777,6 +2799,7 @@
[AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */
#include <fcntl.h>
#include <stdlib.h>
+#include <unistd.h>
main(argc, argv)
int argc;
char *argv[];
@@ -2930,6 +2953,7 @@
AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) &&
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
+#include <stdlib.h>
#ifdef HPUX10DYNAMIC
#include <dl.h>
#define RTLD_LAZY BIND_DEFERRED
|