]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make krb5kdc -p affect TCP ports 815/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 17 Jul 2018 15:29:19 +0000 (11:29 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 18 Jul 2018 22:14:41 +0000 (18:14 -0400)
Now that the KDC listens for TCP connections by default (ticket 6731),
the "-p" option should affect both UDP and TCP default listening
ports.

ticket: 8715 (new)

doc/admin/admin_commands/krb5kdc.rst
src/kdc/main.c

index 7ec4ee4d3151a4b699a543ef100f41b4956bbad0..bda2c015ce9837587362c0bb55f789b38f37c65b 100644 (file)
@@ -57,12 +57,12 @@ The **-P** *pid_file* option tells the KDC to write its PID into
 the KDC is still running and to allow init scripts to stop the correct
 process.
 
-The **-p** *portnum* option specifies the default UDP port numbers
-which the KDC should listen on for Kerberos version 5 requests, as a
-comma-separated list.  This value overrides the UDP port numbers
-specified in the :ref:`kdcdefaults` section of :ref:`kdc.conf(5)`, but
-may be overridden by realm-specific values.  If no value is given from
-any source, the default port is 88.
+The **-p** *portnum* option specifies the default UDP and TCP port
+numbers which the KDC should listen on for Kerberos version 5
+requests, as a comma-separated list.  This value overrides the port
+numbers specified in the :ref:`kdcdefaults` section of
+:ref:`kdc.conf(5)`, but may be overridden by realm-specific values.
+If no value is given from any source, the default port is 88.
 
 The **-w** *numworkers* option tells the KDC to fork *numworkers*
 processes to listen to the KDC ports and process requests in parallel.
index 96281ada3aecb080f506d415e01c7e885b525a33..408c723f52f09f243a5c8e2db52982fc1d7891e6 100644 (file)
@@ -782,19 +782,15 @@ initialize_realms(krb5_context kcontext, int argc, char **argv,
             pid_file = optarg;
             break;
         case 'p':
-            if (def_udp_listen)
-                free(def_udp_listen);
+            free(def_udp_listen);
+            free(def_tcp_listen);
             def_udp_listen = strdup(optarg);
-            if (!def_udp_listen) {
+            def_tcp_listen = strdup(optarg);
+            if (def_udp_listen == NULL || def_tcp_listen == NULL) {
                 fprintf(stderr, _(" KDC cannot initialize. Not enough "
                                   "memory\n"));
                 exit(1);
             }
-#if 0 /* not yet */
-            if (default_tcp_ports)
-                free(default_tcp_ports);
-            default_tcp_ports = strdup(optarg);
-#endif
             break;
         case 'T':
             time_offset = atoi(optarg);