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

Why do they have code that's trying to remove /var?

Doing something stupid and relying on the safety equipment to save you is a stunt. Doing it with someone else's stuff is being an asshole. This is not the behavior of sober grown-ups.




could be something as simple as "rm /var/$myfile" with myfile being null or unset. As long as /var isn't owned by the current user and/or SIP is installed, testing won't let them know they have a problem.


This is why you should always construct paths in particular and URIs in general using your languages' path APIs instead of string interpolation.

That doesn't protect you fully. You still have to check that $myfile is not undefined or "", but it helps with related problems and it tends to arrange the code in such a way that the lack of further sanity checks sticks out a bit more.




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

Search: