fix(main/ngircd): Fix seccomp crashes with setuid and setgid (#19772)

This commit is contained in:
Biswapriyo Nath 2024-04-15 15:37:26 +05:30 committed by GitHub
parent 94b3e0b124
commit ef03a33e75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 34 additions and 1 deletions

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Free, portable and lightweight Internet Relay Chat serve
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@yonle <yonle@protonmail.com>"
TERMUX_PKG_VERSION=26.1
TERMUX_PKG_REVISION=2
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL="https://github.com/ngircd/ngircd/releases/download/rel-${TERMUX_PKG_VERSION}/ngircd-26.tar.xz"
TERMUX_PKG_SHA256=56dcc6483058699fcdd8e54f5010eecee09824b93bad7ed5f18818e550d855c6
TERMUX_PKG_AUTO_UPDATE=true

View File

@ -0,0 +1,20 @@
Fix seccomp crash with setuid(0)
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -737,7 +737,6 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
"Can't drop supplementary group IDs: setgroups(3) missing!");
#endif
}
-#endif
/* Change user ID */
if (getuid() != Conf_UID) {
@@ -751,6 +750,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
goto out;
}
}
+#endif
initialized = true;

View File

@ -0,0 +1,13 @@
Fix seccomp crash with setgid(9999)
--- a/src/portab/portab.h
+++ b/src/portab/portab.h
@@ -128,7 +128,7 @@ typedef unsigned char bool;
# define HOST_VENDOR "unknown"
#endif
-#ifdef __HAIKU__
+#if defined(__HAIKU__) || defined(__ANDROID__)
# define SINGLE_USER_OS
#endif