2 ms·
MariaDB explicitly checks if the port is non-zero before listening on a TCP socket: https://github.com/MariaDB/server/blob/ae998c22b2ce4f1023a6c9c2e925324e2c86
by rvnx 2y ago
MariaDB explicitly checks if the port is non-zero before listening on a TCP socket:
https://github.com/MariaDB/server/blob/ae998c22b2ce4f1023a6c9c2e925324e2c86c6a1/sql/mysqld.cc#L2714 https://github.com/MariaDB/server/blob/ae998c22b2ce4f1023a6c...
> if (mysqld_port)
> activate_tcp_port(mysqld_port, &listen_sockets, false);
if (mysqld_port) means "if mysqld_port is different from 0"
This seems to be at least in MariaDB 5.5 (year 2012)
- rockskon 2y agoAnd if you set MariaDB to not have Internet connectivity, it attempts to accomplish this by setting the TCP port to 0. Ostensibly because it's not supposed to be a valid TCP port, except it actually is on thousands and thousands of systems. So I don't know if the check you're referencing is evaluated when someone sets their instance of MariaDB to "not" be internet accessible.
- qzzi 2y agoThis is the place where the listening socket is initialized, and you can see that if the port is 0, it doesn't do anything. Are you observing different behavior?