chiark / gitweb /
netcat: Make -c work (fix bin/sh, closes #777)
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 17 Feb 2017 10:51:59 +0000 (11:51 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 17 Feb 2017 10:51:59 +0000 (11:51 +0100)
packages/nmap/build.sh
packages/nmap/ncat-bin-sh-path.patch [new file with mode: 0644]

index 1ba98d9eabde0376d8fe11202c1e43030f449b5a..71e7bf3228ad1fb75cbacddbfc62098c35ca36c1 100644 (file)
@@ -1,6 +1,7 @@
 TERMUX_PKG_HOMEPAGE=https://nmap.org/
 TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing"
 TERMUX_PKG_VERSION=7.40
+TERMUX_PKG_REVISION=1
 TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2
 TERMUX_PKG_SHA256=9e14665fffd054554d129d62c13ad95a7b5c7a046daa2290501909e65f4d3188
 # Depend on netcat so that it gets installed automatically when installing
diff --git a/packages/nmap/ncat-bin-sh-path.patch b/packages/nmap/ncat-bin-sh-path.patch
new file mode 100644 (file)
index 0000000..b6b6b36
--- /dev/null
@@ -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: