ubuntu / wsl-setup

WSL setup starts the setup and reconfigure GUI or TUI
GNU General Public License v3.0
17 stars 4 forks source link

Fix Coverity warnings and changed enter_target_ns() function to use pidfd_open syscall. #6

Closed CarlosNihelton closed 2 years ago

CarlosNihelton commented 2 years ago

I gotta confess I liked better the implementation of enter_target_ns() function with the referred system call than by manipulating the /proc/#/ns/* paths.

About the possible buffer overruns with readlink() and leaking file descriptors when fd=0, we should be fine now.

didrocks commented 2 years ago

I trust your testing, the code itself actually looks fine. Let’s upload with it, thanks!