Skip to content
Snippets Groups Projects
Select Git revision
  • 3.10
  • 3.11
  • main default protected
  • revert-15688-bpo-38031-_io-FileIO-opener-crash
  • 3.8
  • 3.9
  • 3.7
  • enum-fix_auto
  • branch-v3.11.0
  • backport-c3648f4-3.11
  • gh-93963/remove-importlib-resources-abcs
  • refactor-wait_for
  • shared-testcase
  • v3.12.0a2
  • v3.12.0a1
  • v3.11.0
  • v3.8.15
  • v3.9.15
  • v3.10.8
  • v3.7.15
  • v3.11.0rc2
  • v3.8.14
  • v3.9.14
  • v3.7.14
  • v3.10.7
  • v3.11.0rc1
  • v3.10.6
  • v3.11.0b5
  • v3.11.0b4
  • v3.10.5
  • v3.11.0b3
  • v3.11.0b2
  • v3.9.13
33 results

2022-07-14-00-43-52.gh-issue-94821.e17ghU.rst

Blame
    • Miss Islington (bot)'s avatar
      65d87a2c
      gh-94821: Fix autobind of empty unix domain address (GH-94826) · 65d87a2c
      Miss Islington (bot) authored
      
      
      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 f6b3a07b (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
      (cherry picked from commit c22f1342)
      
      Co-authored-by: default avatarNir Soffer <nsoffer@redhat.com>
      gh-94821: Fix autobind of empty unix domain address (GH-94826)
      Miss Islington (bot) authored
      
      
      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 f6b3a07b (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
      (cherry picked from commit c22f1342)
      
      Co-authored-by: default avatarNir Soffer <nsoffer@redhat.com>