From: Mark Wielaard Date: Sat, 28 Mar 2020 20:42:04 +0000 (-0400) Subject: PR25728: disable debuginfod --port=0 X-Git-Tag: elfutils-0.179~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2035c1148209633fb006c9f384b744944256b77;p=thirdparty%2Felfutils.git PR25728: disable debuginfod --port=0 When starting debuginfod with --port=0 it would start using a random port (possibly different for ipv4 and ipv6). This seems to be an accidental and not very useful functionality. Just produce an error when started with --port=0. https://sourceware.org/bugzilla/show_bug.cgi?id=25728 Signed-off-by: Mark Wielaard Signed-off-by: Frank Ch. Eigler --- diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index ec5d57412..193c27210 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,7 @@ +2020-03-27 Mark Wielaard + + * debuginfod.cxx (parse_opt): Check port is not zero. + 2020-03-28 Frank Ch. Eigler * debuginfod.cxx (handle_buildid_r_match): During archive diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 9f08a683f..76f1fa52c 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -422,7 +422,8 @@ parse_opt (int key, char *arg, case 'v': verbose ++; break; case 'd': db_path = string(arg); break; case 'p': http_port = (unsigned) atoi(arg); - if (http_port > 65535) argp_failure(state, 1, EINVAL, "port number"); + if (http_port == 0 || http_port > 65535) + argp_failure(state, 1, EINVAL, "port number"); break; case 'F': scan_files = true; break; case 'R': diff --git a/doc/ChangeLog b/doc/ChangeLog index 25404e587..068a19575 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2020-03-28 Frank Ch. Eigler + + * debuginfod.8: Document valid --port=NUM range, excludes 0. + 2020-03-27 Frank Ch. Eigler * debuginfod-find.1: Document /path/-based buildid passing. diff --git a/doc/debuginfod.8 b/doc/debuginfod.8 index d8fbbea09..a645ceed5 100644 --- a/doc/debuginfod.8 +++ b/doc/debuginfod.8 @@ -130,9 +130,10 @@ repeated. The default is nothing extra. .TP .B "\-p NUM" "\-\-port=NUM" -Set the TCP port number on which debuginfod should listen, to service -HTTP requests. Both IPv4 and IPV6 sockets are opened, if possible. -The webapi is documented below. The default port number is 8002. +Set the TCP port number (0 < NUM < 65536) on which debuginfod should +listen, to service HTTP requests. Both IPv4 and IPV6 sockets are +opened, if possible. The webapi is documented below. The default +port number is 8002. .TP .B "\-I REGEX" "\-\-include=REGEX" "\-X REGEX" "\-\-exclude=REGEX"