zsh: avoid set(*)uid & set(*)gid calls

They are blocked by seccomp on recent Android OS versions.
This commit is contained in:
Leonid Pliushch 2020-04-21 15:26:34 +03:00
parent c7a75528cb
commit 27caa7032b
2 changed files with 24 additions and 1 deletions

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.zsh.org
TERMUX_PKG_DESCRIPTION="Shell with lots of features"
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_VERSION=5.8
TERMUX_PKG_REVISION=2
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/zsh-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=dcc4b54cc5565670a65581760261c163d720991f0d06486da61f8d839b52de27
# Remove hard link to bin/zsh as Android does not support hard links:

View File

@ -0,0 +1,23 @@
diff -uNr zsh-5.8/Src/openssh_bsd_setres_id.c zsh-5.8.mod/Src/openssh_bsd_setres_id.c
--- zsh-5.8/Src/openssh_bsd_setres_id.c 2020-02-15 00:06:57.000000000 +0200
+++ zsh-5.8.mod/Src/openssh_bsd_setres_id.c 2020-04-21 15:25:43.002562224 +0300
@@ -59,6 +59,9 @@
int
setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{
+#ifdef __ANDROID__
+ return 0;
+#endif
int ret = 0, saved_errno;
if (rgid != sgid) {
@@ -94,6 +97,9 @@
int
setresuid(uid_t ruid, uid_t euid, uid_t suid)
{
+#ifdef __ANDROID__
+ return 0;
+#endif
int ret = 0, saved_errno;
if (ruid != suid) {