$ grep 'unsafe {' -R ~/oxy --include=*.rs | wc -l
13
Not bad.
$ grep 'unsafe {' -R ~/oxy --include=*.rs | wc -l
13
Not bad.
https://github.com/oxy-secure/oxy/blob/571ef12199f8b0f3eca55...
In fact a smart optimizing compiler can make that even harder to avoid since it is more difficult to know exactly what machine code it will produce.
They will definitely lower the performance, but likely a bit slower and more secure connection process is preferable to a less secure one.
- in ui.rs, for resetting the blocking state of stdin via fcntl
- in tuntap.rs, for an ioctl to do some tun/tap setup, and resetting errno beforehand
- in pty.rs, for ioctls for controlling terminal admin and setting the terminal size
- in util.rs, for getting the current UID, calling getpwnam or getpwuid, and extracting field values from the resulting passwd struct
I have to confess that i don't know the details of the Linux API well enough to know for sure, but they all look eminently reasonable.