Hacker News new | past | comments | ask | show | jobs | submit login

You can do this without assuming the name by execing /proc/$PID/exe. Then you're not vulnerable to the argv[0] spoofing described in the article. (But of course since argv[0] does exist, you should set it properly and pass through your own argv[0] unchanged.)



That's not portable, though. OpenBSD, for example, doesn't have /proc.


That’s Linux only. Wouldn’t even work on macOS, which would likely be a significant number of your users.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: