If a Crystal language process is running as root, can it change it's euid/uid to something else? For example:
old_euid, old_ui = Process.euid, Process.uid
Process.euid = someone_else
Process.uid = someone_else
If a Crystal language process is running as root, can it change it's euid/uid to something else? For example:
old_euid, old_ui = Process.euid, Process.uid
Process.euid = someone_else
Process.uid = someone_else
Yes, by using bindings to libc:
The program needs to be running as root of course (i. e.
sudo crystal source.cr
)