Prefer chmod u plus x to plus x

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the security category.

Last Updated: 2024-11-21

I was in the habit of always using chmod +x on my scripts.

This was not great.

I should use chmod u+x over chmod +x. The former gives execute rights just for the current user, the latter for all users, which is too lenient.