Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:GA
netcat-openbsd.5831
getservbyname.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File getservbyname.patch of Package netcat-openbsd.5831
Index: netcat-openbsd-1.89/netcat.c =================================================================== --- netcat-openbsd-1.89.orig/netcat.c 2008-01-22 20:39:46.000000000 -0500 +++ netcat-openbsd-1.89/netcat.c 2008-01-22 20:43:36.000000000 -0500 @@ -819,11 +819,18 @@ void build_ports(char *p) { + struct servent *sv; char *n, *endp; 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) { if (lflag) errx(1, "Cannot use -l with multiple ports!");
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor