Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a number of potential fd leaks #1636

Merged
merged 8 commits into from
Nov 30, 2022

Commits on Nov 25, 2022

  1. Don't leak fds on error in UDS on Unix

    We do this by simply creating a fd-managing type, e.g. UnixDatagram,
    from the fd once it's created.
    
    Also first tries to parse the path as that can fail without doing a
    system call.
    Thomasdezeeuw committed Nov 25, 2022
    Configuration menu
    Copy the full SHA
    337e167 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2022

  1. Configuration menu
    Copy the full SHA
    09ca024 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    83410d0 View commit details
    Browse the repository at this point in the history
  3. Make fd handling code consistent for Unix

    Now all the fd creating code follows the following pattern.
    
    let raw_fd = create_fd();
    let managed_fd = wrap(raw_fd);
    // Additional system calls
    return managed_fd
    Thomasdezeeuw committed Nov 28, 2022
    Configuration menu
    Copy the full SHA
    c88aed4 View commit details
    Browse the repository at this point in the history
  4. Initialise the Window network stack in one call site

    Do it in new_socket so that the higher levels don't have to worry about
    it.
    Thomasdezeeuw committed Nov 28, 2022
    Configuration menu
    Copy the full SHA
    b3cf5f4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cac02d4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    30c5e19 View commit details
    Browse the repository at this point in the history
  7. Fix Clippy warnings

    Don't agree with the `&path` -> `path`, but it's fine.
    Thomasdezeeuw committed Nov 28, 2022
    Configuration menu
    Copy the full SHA
    f4912ab View commit details
    Browse the repository at this point in the history