aboutsummaryrefslogtreecommitdiffstats
path: root/main/netcat-openbsd/0003-get-sev-by-name.patch
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-04-10 14:38:03 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-04-10 14:39:08 +0000
commit3a368567d8f1bcf4935151dfaf5759453c67d1e6 (patch)
tree266240778882c9152733656249f3dc2dffecf837 /main/netcat-openbsd/0003-get-sev-by-name.patch
parentbe30326a67f37a658677e8afa2959ee9ea3661f8 (diff)
downloadaports-3a368567d8f1bcf4935151dfaf5759453c67d1e6.tar.bz2
aports-3a368567d8f1bcf4935151dfaf5759453c67d1e6.tar.xz
main/netcat-openbsd: upgrade to 1.130, disable check(), modernize APKBUILD
Diffstat (limited to 'main/netcat-openbsd/0003-get-sev-by-name.patch')
-rw-r--r--main/netcat-openbsd/0003-get-sev-by-name.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/main/netcat-openbsd/0003-get-sev-by-name.patch b/main/netcat-openbsd/0003-get-sev-by-name.patch
new file mode 100644
index 0000000000..c5ba82ee69
--- /dev/null
+++ b/main/netcat-openbsd/0003-get-sev-by-name.patch
@@ -0,0 +1,34 @@
+From: Aron Xu <aron@debian.org>
+Date: Mon, 13 Feb 2012 14:45:08 +0800
+Subject: get sev by name
+
+---
+ netcat.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/netcat.c b/netcat.c
+index d40e3a5..e0ad5c7 100644
+--- a/netcat.c
++++ b/netcat.c
+@@ -1193,12 +1193,19 @@ atelnet(int nfd, unsigned char *buf, unsigned int size)
+ void
+ build_ports(char *p)
+ {
++ struct servent *sv;
+ const char *errstr;
+ char *n;
+ int hi, lo, cp;
+ int x = 0;
+
+- if ((n = strchr(p, '-')) != NULL) {
++ sv = getservbyname(p, uflag ? "udp" : "tcp");
++ if (sv) {
++ portlist[0] = calloc(1, PORT_MAX_LEN);
++ if (portlist[0] == NULL)
++ err(1, NULL);
++ snprintf(portlist[0], PORT_MAX_LEN, "%d", ntohs(sv->s_port));
++ } else if ((n = strchr(p, '-')) != NULL) {
+ *n = '\0';
+ n++;
+
+--