Browse Source

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

They are blocked by seccomp on recent Android OS versions.
master
Leonid Plyushch 5 years ago
parent
commit
3ca0a5506e
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 2
      packages/zsh/build.sh
  2. 23
      packages/zsh/no-priv-calls.patch

2
packages/zsh/build.sh

@ -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:

23
packages/zsh/no-priv-calls.patch

@ -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) {
Loading…
Cancel
Save