Nir Soffer
c22f134211
gh-94821: Fix autobind of empty unix domain address (GH-94826)
...
When binding a unix socket to an empty address on Linux, the socket is
automatically bound to an available address in the abstract namespace.
>>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> s.bind("")
>>> s.getsockname()
b'\x0075499'
Since python 3.9, the socket is bound to the one address:
>>> s.getsockname()
b'\x00'
And trying to bind multiple sockets will fail with:
Traceback (most recent call last):
File "/home/nsoffer/src/cpython/Lib/test/test_socket.py", line 5553, in testAutobind
s2.bind("")
OSError: [Errno 98] Address already in use
Added 2 tests:
- Auto binding empty address on Linux
- Failing to bind an empty address on other platforms
Fixes f6b3a07b7df6 (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
2022-07-15 09:13:33 +03:00
..
2022-03-26 20:52:24 +01:00
2022-07-03 11:58:02 -07:00
2022-05-13 12:41:05 +02:00
2022-06-22 14:02:14 +02:00
2022-07-11 13:12:36 +01:00
2022-03-26 21:36:08 +01:00
2022-07-08 00:33:17 +02:00
2022-06-17 01:19:44 -07:00
2022-05-03 20:25:41 +02:00
2022-07-13 13:22:45 +02:00
2021-10-06 16:22:09 -07:00
2022-06-14 07:15:26 +03:00
2022-06-24 11:05:53 +02:00
2022-03-07 21:46:18 +00:00
2022-02-08 13:39:07 -07:00
2022-07-11 13:32:11 +01:00
2022-05-28 13:08:06 -05:00
2022-06-29 17:51:36 +02:00
2021-10-14 20:04:19 +03:00
2022-05-03 21:42:14 +02:00
2021-07-27 15:58:12 -07:00
2022-05-13 12:41:05 +02:00
2022-07-07 03:57:45 -07:00
2022-06-14 07:15:26 +03:00
2022-05-03 18:27:38 +02:00
2022-06-14 07:15:26 +03:00
2022-05-03 21:42:14 +02:00
2022-02-16 18:57:28 +09:00
2022-06-21 22:04:03 +02:00
2021-10-22 15:36:28 +02:00
2022-07-02 08:24:19 +02:00
2022-04-09 09:54:54 +09:00
2022-07-05 20:18:47 +02:00
2022-03-05 01:38:56 +09:00
2021-10-25 01:25:27 -07:00
2022-07-01 15:33:35 +01:00
2022-06-21 22:04:03 +02:00
2022-06-28 10:01:43 +03:00
2022-05-27 15:05:35 +02:00
2022-02-11 17:22:11 +01:00
2022-02-11 17:22:11 +01:00
2022-07-09 18:11:15 +02:00
2022-03-02 00:38:21 +09:00
2022-06-26 12:12:01 +02:00
2022-05-03 21:42:14 +02:00
2022-04-28 16:30:28 +02:00
2022-07-08 08:56:26 -07:00
2022-05-16 21:32:48 -04:00
2022-05-03 21:42:14 +02:00
2022-05-03 21:42:14 +02:00
2022-03-17 13:05:52 +02:00
2022-04-07 12:31:01 -07:00
2021-07-22 23:06:54 +02:00
2021-11-24 10:20:37 +01:00
2022-03-07 18:57:45 +09:00
2022-06-07 00:47:27 +01:00
2022-06-19 12:02:33 +02:00
2022-06-14 07:15:26 +03:00
2022-06-14 07:15:26 +03:00
2022-05-03 21:42:14 +02:00
2022-04-07 12:27:35 -07:00
2022-05-25 11:38:47 -04:00
2022-02-25 01:32:57 +01:00
2021-08-24 17:50:05 +01:00
2021-08-06 23:35:13 +02:00
2022-06-19 12:02:33 +02:00
2022-06-06 23:21:58 +02:00
2021-10-07 01:34:42 -07:00
2022-05-27 17:38:01 -06:00
2021-10-21 02:09:03 +09:00
2022-06-20 13:34:40 +02:00
2021-12-03 00:08:42 +00:00
2022-04-05 02:05:36 -04:00
2022-06-16 22:41:57 +01:00
2021-10-01 14:38:49 +02:00
2022-02-15 09:02:21 +09:00
2022-06-17 16:12:00 +02:00
2022-06-29 15:44:14 +02:00
2022-06-12 18:45:02 +09:00
2021-10-22 15:36:28 +02:00
2022-06-29 07:20:53 +02:00
2022-05-03 21:42:14 +02:00
2022-04-20 13:46:08 +03:00
2022-06-29 12:24:51 +02:00
2022-06-14 07:15:26 +03:00
2021-11-25 12:28:41 +01:00
2022-02-07 16:21:31 +01:00
2022-06-19 12:02:33 +02:00
2021-10-13 19:25:53 +02:00
2022-02-05 20:52:01 +01:00
2022-03-14 14:40:28 +01:00
2022-07-14 00:51:49 -07:00
2022-04-04 10:53:26 +03:00
2022-07-14 00:51:49 -07:00
2021-10-22 15:36:28 +02:00
2021-10-22 15:36:28 +02:00
2021-10-22 15:36:28 +02:00
2022-06-20 13:34:40 +02:00
2022-07-15 09:13:33 +03:00
2022-05-25 04:44:57 +02:00
2022-04-23 14:48:17 -07:00
2022-05-03 21:42:14 +02:00
2021-10-03 16:58:14 +03:00
2022-06-14 07:15:26 +03:00
2021-09-14 11:00:38 -07:00
2022-04-15 10:44:05 +09:00
2021-09-14 11:00:38 -07:00
2022-06-10 12:39:02 +02:00
2022-05-03 21:42:14 +02:00
2022-06-10 12:39:02 +02:00
2022-05-03 21:42:14 +02:00
2022-03-20 12:28:15 -07:00