summaryrefslogtreecommitdiff
path: root/sys-libs/gpm/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
commitfcc5224904648a8e6eb528d7603154160a20022f (patch)
tree3bfce096b38a9cea8eed13fc70c1526c456e9abd /sys-libs/gpm/files
parent2fd57282f0262ca084e05b0f2c63fbada395d02b (diff)
gentoo resync : 02.02.2022
Diffstat (limited to 'sys-libs/gpm/files')
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch18
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-musl.patch143
-rw-r--r--sys-libs/gpm/files/gpm-1.20.7-signedness.patch20
3 files changed, 181 insertions, 0 deletions
diff --git a/sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch b/sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch
new file mode 100644
index 000000000000..51d047c465cc
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-gcc-include.patch
@@ -0,0 +1,18 @@
+https://github.com/telmich/gpm/commit/80cac2a2bd7eed7e80626559f792f37319030729
+
+From: "Desmond O. Chang" <dochang@gmail.com>
+Date: Wed, 13 Apr 2016 21:17:48 +0800
+Subject: [PATCH] Add gcc include path
+
+Close #13
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -96,7 +96,7 @@ $(DEPFILE) dep: prog/gpm-root.c
+
+ # create dependencies
+ for DEPS in `echo *.c */*.c`; do \
+- $(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
++ $(CC) -I. -I $(srcdir) -I $(srcdir)/headers -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
+ $(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
+
+ ### INSTALL
diff --git a/sys-libs/gpm/files/gpm-1.20.7-musl.patch b/sys-libs/gpm/files/gpm-1.20.7-musl.patch
new file mode 100644
index 000000000000..37f8542a87aa
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-musl.patch
@@ -0,0 +1,143 @@
+https://github.com/telmich/gpm/commit/d88fb1de5803c366ab62f7de9ee5d83207fb2afe
+https://github.com/telmich/gpm/commit/4a938233fbe6de7af05aabc74891b68d4bae40f8
+https://bugs.gentoo.org/829581
+
+From: Dima Krasner <dima@dimakrasner.com>
+Date: Wed, 12 Nov 2014 23:06:46 +0200
+Subject: [PATCH] Added musl support to libgpm and the daemon.
+
+--- a/src/daemon/open_console.c
++++ b/src/daemon/open_console.c
+@@ -21,6 +21,7 @@
+
+ #include <fcntl.h> /* open and co. */
+ #include <sys/stat.h> /* stat() */
++#include <sys/types.h> /* major() */
+ #include <sys/ioctl.h> /* ioctl */
+
+ /* Linux specific (to be outsourced in gpm2 */
+--- a/src/prog/display-buttons.c
++++ b/src/prog/display-buttons.c
+@@ -36,6 +36,7 @@
+ #include <stdio.h> /* printf() */
+ #include <time.h> /* time() */
+ #include <errno.h> /* errno */
++#include <sys/select.h> /* fd_set and FD_* */
+ #include <gpm.h> /* gpm information */
+
+ /* display resulting data */
+--- a/src/prog/display-coords.c
++++ b/src/prog/display-coords.c
+@@ -38,6 +38,7 @@
+ #include <stdio.h> /* printf() */
+ #include <time.h> /* time() */
+ #include <errno.h> /* errno */
++#include <sys/select.h> /* fd_set and FD_* */
+ #include <gpm.h> /* gpm information */
+
+ /* display resulting data */
+--- a/src/prog/gpm-root.y
++++ b/src/prog/gpm-root.y
+@@ -1199,9 +1199,9 @@ int main(int argc, char **argv)
+ #if defined(__GLIBC__)
+ __sigemptyset(&childaction.sa_mask);
+ #else /* __GLIBC__ */
+- childaction.sa_mask=0;
++ sigemptyset(&childaction.sa_mask);
+ #endif /* __GLIBC__ */
+- childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
++ childaction.sa_flags=0;
+ sigaction(SIGCHLD,&childaction,NULL);
+
+ /*....................................... Connect and get your buffer */
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Sat, 29 Dec 2018 23:44:24 -0600
+Subject: [PATCH 1/4] Update gpm.c
+
+--- a/src/daemon/gpm.c
++++ b/src/daemon/gpm.c
+@@ -29,7 +29,7 @@
+ #include <signal.h> /* SIGPIPE */
+ #include <time.h> /* time() */
+ #include <sys/param.h>
+-#include <sys/fcntl.h> /* O_RDONLY */
++#include <fcntl.h> /* O_RDONLY */
+ #include <sys/wait.h> /* wait() */
+ #include <sys/stat.h> /* mkdir() */
+ #include <sys/time.h> /* timeval */
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Sat, 29 Dec 2018 23:47:17 -0600
+Subject: [PATCH 2/4] Add include <string.h>
+
+Added
+ line 28, #include <string.h> /* strcpy, bzero */
+for musl compilation
+--- a/src/daemon/old_main.c
++++ b/src/daemon/old_main.c
+@@ -25,6 +25,7 @@
+ #include <signal.h> /* guess again */
+ #include <errno.h> /* guess again */
+ #include <unistd.h> /* unlink */
++#include <string.h> /* strcpy, bzero */
+ #include <sys/stat.h> /* chmod */
+
+ #include <linux/kd.h> /* linux hd* */
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Sat, 29 Dec 2018 23:52:58 -0600
+Subject: [PATCH 3/4] Update liblow.c for musl compatible
+
+Changed #include <sys/fcntl.h> to #include <fcntl.h>
+Changed SA_NOMASK to SA_NODEFER on lines 176, 367
+--- a/src/lib/liblow.c
++++ b/src/lib/liblow.c
+@@ -33,7 +33,7 @@
+ #include <sys/types.h> /* socket() */
+ #include <sys/socket.h> /* socket() */
+ #include <sys/un.h> /* struct sockaddr_un */
+-#include <sys/fcntl.h> /* O_RDONLY */
++#include <fcntl.h> /* O_RDONLY */
+ #include <sys/stat.h> /* stat() */
+
+ #ifdef SIGTSTP /* true if BSD system */
+@@ -173,7 +173,7 @@ static void gpm_suspend_hook (int signum)
+ /* Reincarnation. Prepare for another death early. */
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = gpm_suspend_hook;
+- sa.sa_flags = SA_NOMASK;
++ sa.sa_flags = SA_NODEFER;
+ sigaction (SIGTSTP, &sa, 0);
+
+ /* Pop the gpm stack by closing the useless connection */
+@@ -364,7 +364,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
+
+ /* if signal was originally ignored, job control is not supported */
+ if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) {
+- sa.sa_flags = SA_NOMASK;
++ sa.sa_flags = SA_NODEFER;
+ sa.sa_handler = gpm_suspend_hook;
+ sigaction(SIGTSTP, &sa, 0);
+ }
+
+From: Kurt Nalty <46026992+kurtnalty@users.noreply.github.com>
+Date: Mon, 31 Dec 2018 18:41:19 -0600
+Subject: [PATCH 4/4] Aligned comments
+
+--- a/src/lib/liblow.c
++++ b/src/lib/liblow.c
+@@ -29,11 +29,12 @@
+ #include <string.h> /* strncmp */
+ #include <unistd.h> /* select(); */
+ #include <errno.h>
++#include <fcntl.h> /* O_RDONLY */
++
+ #include <sys/time.h> /* timeval */
+ #include <sys/types.h> /* socket() */
+ #include <sys/socket.h> /* socket() */
+ #include <sys/un.h> /* struct sockaddr_un */
+-#include <fcntl.h> /* O_RDONLY */
+ #include <sys/stat.h> /* stat() */
+
+ #ifdef SIGTSTP /* true if BSD system */
diff --git a/sys-libs/gpm/files/gpm-1.20.7-signedness.patch b/sys-libs/gpm/files/gpm-1.20.7-signedness.patch
new file mode 100644
index 000000000000..3904bfd6cca3
--- /dev/null
+++ b/sys-libs/gpm/files/gpm-1.20.7-signedness.patch
@@ -0,0 +1,20 @@
+https://github.com/telmich/gpm/commit/4337fd9fc2d2ea83654f2ca69245503730231ac3
+
+From: iljavs <ivansprundel@ioactive.com>
+Date: Mon, 27 Jun 2016 01:17:57 -0700
+Subject: [PATCH] fix signedness issue
+
+This commit fixes a signedness issue, where a negative vc coming from a malicious client could possibly cause memory corruption.
+--- a/src/daemon/processconn.c
++++ b/src/daemon/processconn.c
+@@ -67,7 +67,8 @@ int processConn(int fd)
+ return -1;
+ }
+
+- if((vc = request->vc) > MAX_VC) {
++ vc = request->vc;
++ if(vc > MAX_VC || vc < 0) {
+ gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
+ free(info);
+ close(newfd);
+