lucab / libsystemd-rs

A pure-Rust client library to work with systemd
https://crates.io/crates/libsystemd
Other
105 stars 19 forks source link

Close our side of memfd #88

Closed swsnr closed 3 years ago

swsnr commented 3 years ago

Sending a file descriptor through a socket effectively duplicates the file descriptor; it does not move the file descriptor out of the current process.

Hence we need to close our side of the file descriptor explicitly to avoid leaking file descriptors.

lucab commented 3 years ago

Ouch! Good find. Did you spot this on a running process? Does it need a minor bugfix release on its own?

swsnr commented 3 years ago

No I found this accidentally. It only occurs for very large messages. But still, I'd like to fix it 🙂

swsnr commented 3 years ago

Thanks for merging. I don't think it's that urgent, so I'd make #87 next and then cut a new release?