mtools: fix "bad system call" errors
This commit is contained in:
parent
49fd59aa6e
commit
7e66fa991c
@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/mtools/
|
||||
TERMUX_PKG_DESCRIPTION="Tool for manipulating FAT images."
|
||||
TERMUX_PKG_LICENSE="GPL-2.0"
|
||||
TERMUX_PKG_VERSION=4.0.23
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SHA256=f188db26751aeb5692a79b2380b440ecc05fd1848a52f869d7ca1193f2ef8ee3
|
||||
TERMUX_PKG_REVISION=3
|
||||
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/mtools/mtools-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=f188db26751aeb5692a79b2380b440ecc05fd1848a52f869d7ca1193f2ef8ee3
|
||||
TERMUX_PKG_DEPENDS="libandroid-support, libiconv"
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
|
54
packages/mtools/no-privs.patch
Normal file
54
packages/mtools/no-privs.patch
Normal file
@ -0,0 +1,54 @@
|
||||
diff -uNr mtools-4.0.23/privileges.c mtools-4.0.23.mod/privileges.c
|
||||
--- mtools-4.0.23/privileges.c 2018-12-09 12:57:33.000000000 +0200
|
||||
+++ mtools-4.0.23.mod/privileges.c 2020-01-10 12:49:08.689245870 +0200
|
||||
@@ -93,6 +93,9 @@
|
||||
|
||||
static __inline__ void Setuid(uid_t uid)
|
||||
{
|
||||
+#ifdef __ANDROID__
|
||||
+ return;
|
||||
+#endif
|
||||
#if defined HAVE_SETEUID || defined HAVE_SETRESUID
|
||||
if(euid == 0) {
|
||||
#ifdef HAVE_SETEUID
|
||||
@@ -110,6 +113,9 @@
|
||||
|
||||
void reclaim_privs(void)
|
||||
{
|
||||
+#ifdef __ANDROID__
|
||||
+ return;
|
||||
+#endif
|
||||
if(noPrivileges)
|
||||
return;
|
||||
setgid(egid);
|
||||
@@ -119,6 +125,9 @@
|
||||
|
||||
void drop_privs(void)
|
||||
{
|
||||
+#ifdef __ANDROID__
|
||||
+ return;
|
||||
+#endif
|
||||
Setuid(ruid);
|
||||
setgid(rgid);
|
||||
print_privs("after drop_privs, real should be 0, effective should not ");
|
||||
@@ -126,7 +135,9 @@
|
||||
|
||||
void destroy_privs(void)
|
||||
{
|
||||
-
|
||||
+#ifdef __ANDROID__
|
||||
+ return;
|
||||
+#endif
|
||||
#if defined HAVE_SETEUID || defined HAVE_SETRESUID
|
||||
if(euid == 0) {
|
||||
#ifdef HAVE_SETEUID
|
||||
@@ -159,6 +170,9 @@
|
||||
|
||||
void init_privs(void)
|
||||
{
|
||||
+#ifdef __ANDROID__
|
||||
+ return;
|
||||
+#endif
|
||||
euid = geteuid();
|
||||
ruid = getuid();
|
||||
egid = getegid();
|
Loading…
Reference in New Issue
Block a user