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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The permissions you can set on a file with
chmodaffect 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).