diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/platform-quirks.diff | 47 | ||||
-rw-r--r-- | debian/patches/series | 3 | ||||
-rw-r--r-- | debian/patches/upstream-0f6227f46b.diff | 42 | ||||
-rw-r--r-- | debian/patches/upstream-19344efa78.diff | 34 |
4 files changed, 126 insertions, 0 deletions
diff --git a/debian/patches/platform-quirks.diff b/debian/patches/platform-quirks.diff new file mode 100644 index 0000000..e46fe56 --- /dev/null +++ b/debian/patches/platform-quirks.diff @@ -0,0 +1,47 @@ +Description: Platform-specific fixes + * Define PATH_MAX, MAX_IOV for Hurd. + * Add workaround for broken GNU/kFreeBSD system headers. +Author: Karl Ferdinand Ebert <kfebert@gmail.com> +Author: Romain Francoise <rfrancoise@debian.org> +Author: James Clarke <jrtc27@debian.org> +Bug-Debian: http://bugs.debian.org/609333 +Forwarded: not-needed + +--- a/compat.h ++++ b/compat.h +@@ -21,6 +21,20 @@ + #include <sys/ioctl.h> + #include <sys/uio.h> + ++/* ++ * Shouldn't be needed, but GNU/kFreeBSD headers are currently slightly broken. ++ * The glibc limits.h eventually includes the FreeBSD limits-related headers, ++ * which don't define a TTY_NAME_MAX. However, anything (in)directly including ++ * the glibc sys/param.h will include the glibc bits/param.h, which defines ++ * TTY_NAME_MAX as SPECNAMELEN, i.e. 63, which differs from our fallback of 32. ++ * Thus, without this hack, different source files can (and do) end up with ++ * different values for TTY_NAME_MAX, which among other things affects the ++ * layout of struct window_pane due to the tty buffer. ++ */ ++#ifdef __FreeBSD_kernel__ ++#include <sys/param.h> ++#endif ++ + #include <fnmatch.h> + #include <limits.h> + #include <stdio.h> +@@ -289,6 +303,14 @@ void explicit_bzero(void *, size_t); + int getdtablecount(void); + #endif + ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ ++#ifndef IOV_MAX ++#define IOV_MAX 1024 ++#endif ++ + #ifndef HAVE_CLOSEFROM + /* closefrom.c */ + void closefrom(int); diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..d91ad53 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,3 @@ +platform-quirks.diff +upstream-0f6227f46b.diff +upstream-19344efa78.diff diff --git a/debian/patches/upstream-0f6227f46b.diff b/debian/patches/upstream-0f6227f46b.diff new file mode 100644 index 0000000..c062e60 --- /dev/null +++ b/debian/patches/upstream-0f6227f46b.diff @@ -0,0 +1,42 @@ +commit 0f6227f46b1d33476ef448682a2ba0b0290e6d9b +Author: Nicholas Marriott <nicholas.marriott@gmail.com> +Date: Thu Jun 2 20:41:21 2022 +0000 + + When deleting or renaming a buffer and a buffer name is specified, + complain if the buffer doesn't exist instead of silently deleting or + renaming the most recent buffer. GitHub issue 3205. + +diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c +index 9112683fc0..c9ffe5edad 100644 +--- a/cmd-set-buffer.c ++++ b/cmd-set-buffer.c +@@ -69,8 +69,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) + pb = paste_get_name(bufname); + + if (cmd_get_entry(self) == &cmd_delete_buffer_entry) { +- if (pb == NULL) ++ if (pb == NULL) { ++ if (bufname != NULL) { ++ cmdq_error(item, "unknown buffer: %s", bufname); ++ return (CMD_RETURN_ERROR); ++ } + pb = paste_get_top(&bufname); ++ } + if (pb == NULL) { + cmdq_error(item, "no buffer"); + return (CMD_RETURN_ERROR); +@@ -80,8 +85,13 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) + } + + if (args_has(args, 'n')) { +- if (pb == NULL) ++ if (pb == NULL) { ++ if (bufname != NULL) { ++ cmdq_error(item, "unknown buffer: %s", bufname); ++ return (CMD_RETURN_ERROR); ++ } + pb = paste_get_top(&bufname); ++ } + if (pb == NULL) { + cmdq_error(item, "no buffer"); + return (CMD_RETURN_ERROR); diff --git a/debian/patches/upstream-19344efa78.diff b/debian/patches/upstream-19344efa78.diff new file mode 100644 index 0000000..aa14f19 --- /dev/null +++ b/debian/patches/upstream-19344efa78.diff @@ -0,0 +1,34 @@ +From 19344efa78be23a02008be9da0991f54455c9f9e Mon Sep 17 00:00:00 2001 +From: Nicholas Marriott <nicholas.marriott@gmail.com> +Date: Mon, 22 Aug 2022 08:20:49 +0100 +Subject: [PATCH] Fix fallback implementaion of getpeereid, from Pino Toscano. + +--- + compat/getpeereid.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/compat/getpeereid.c b/compat/getpeereid.c +index c194e886..b79f420a 100644 +--- a/compat/getpeereid.c ++++ b/compat/getpeereid.c +@@ -18,6 +18,7 @@ + #include <sys/socket.h> + + #include <stdio.h> ++#include <unistd.h> + + #ifdef HAVE_UCRED_H + #include <ucred.h> +@@ -49,6 +50,8 @@ getpeereid(int s, uid_t *uid, gid_t *gid) + ucred_free(ucred); + return (0); + #else +- return (getuid()); ++ *uid = geteuid(); ++ *gid = getegid(); ++ return (0); + #endif + } +-- +2.35.1 + |