Browse Source

netcat: Make -c work (fix bin/sh, closes #777)

android-5
Fredrik Fornwall 8 years ago
parent
commit
84ba008445
  1. 1
      packages/nmap/build.sh
  2. 26
      packages/nmap/ncat-bin-sh-path.patch

1
packages/nmap/build.sh

@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://nmap.org/ TERMUX_PKG_HOMEPAGE=https://nmap.org/
TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing" TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing"
TERMUX_PKG_VERSION=7.40 TERMUX_PKG_VERSION=7.40
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=9e14665fffd054554d129d62c13ad95a7b5c7a046daa2290501909e65f4d3188 TERMUX_PKG_SHA256=9e14665fffd054554d129d62c13ad95a7b5c7a046daa2290501909e65f4d3188
# Depend on netcat so that it gets installed automatically when installing # Depend on netcat so that it gets installed automatically when installing

26
packages/nmap/ncat-bin-sh-path.patch

@ -0,0 +1,26 @@
diff -u -r ../nmap-7.40/ncat/ncat_main.c ./ncat/ncat_main.c
--- ../nmap-7.40/ncat/ncat_main.c 2016-12-14 01:12:23.000000000 +0100
+++ ./ncat/ncat_main.c 2017-02-17 11:46:27.468844181 +0100
@@ -965,8 +965,8 @@
#ifndef WIN32
/* See if the shell is executable before we get deep into this */
- if (o.execmode == EXEC_SHELL && access("/bin/sh", X_OK) == -1)
- bye("/bin/sh is not executable, so `-c' won't work.");
+ if (o.execmode == EXEC_SHELL && access("@TERMUX_PREFIX@/bin/sh", X_OK) == -1)
+ bye("@TERMUX_PREFIX@/bin/sh is not executable, so `-c' won't work.");
#endif
if (targetss.storage.ss_family != AF_UNSPEC) {
diff -u -r ../nmap-7.40/ncat/ncat_posix.c ./ncat/ncat_posix.c
--- ../nmap-7.40/ncat/ncat_posix.c 2016-12-14 01:12:23.000000000 +0100
+++ ./ncat/ncat_posix.c 2017-02-17 11:47:09.716313620 +0100
@@ -239,7 +239,7 @@
char **cmdargs;
case EXEC_SHELL:
- execl("/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmdexec, (void *) NULL);
break;
#ifdef HAVE_LUA
case EXEC_LUA:
Loading…
Cancel
Save