]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
PR25728: disable debuginfod --port=0
authorMark Wielaard <mark@klomp.org>
Sat, 28 Mar 2020 20:42:04 +0000 (16:42 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Sat, 28 Mar 2020 20:44:41 +0000 (16:44 -0400)
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 <mark@klomp.org>
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
debuginfod/ChangeLog
debuginfod/debuginfod.cxx
doc/ChangeLog
doc/debuginfod.8

index ec5d5741201393a37c23e07ad5cd3ff882259114..193c272108554caa269d4c8531096d1e3714133c 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-27  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod.cxx (parse_opt): Check port is not zero.
+
 2020-03-28  Frank Ch. Eigler  <fche@redhat.com>
 
        * debuginfod.cxx (handle_buildid_r_match): During archive
index 9f08a683ff15ab8c585fcce3e3d29e2578f8ead3..76f1fa52c510c7c0954fb31df128496d3deae821 100644 (file)
@@ -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':
index 25404e5876ba1e8c9ec91f5a4b09c12ba4de14af..068a1957599dadd57fa985a3ad138fb38915de05 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-28  Frank Ch. Eigler  <fche@redhat.com>
+
+       * debuginfod.8: Document valid --port=NUM range, excludes 0.
+
 2020-03-27  Frank Ch. Eigler  <fche@redhat.com>
 
        * debuginfod-find.1: Document /path/-based buildid passing.
index d8fbbea09ee9c997202f70828fda7a66de5e0800..a645ceed5eaaf61981c2104724e5142e510c17e2 100644 (file)
@@ -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"