Issue
I have to change file permissions on an executable file, using os.chmod
.
I have this executable and I want to change its permissions so that it can write nowhere, only reading and executing.
How can I do that?
Thanks,
rubik
Solution
The permissions you can set on a file with chmod
affect who can read from/write to/execute that file, not what privileges the process created by running that file has.
On Unix you could get some form of protection by playing with the file owner and the sticky bit, and having appropriate permissions on your filesystem, but that's not easy to get right and doesn't work on Windows (no sticky bit there).
Answered By - Mat Answer Checked By - Timothy Miller (WPSolving Admin)