I'm hoping this is the right forum to ask this question. Anyway the problem is that I have a file located on cgi-bin that I've CHMOD to 755 but every so often the permission is reset to 0. I'm not sure why it's happening at all since it doesn't affect any other files that is located on the same directory. The directory itself (cgi-bin) has a CHMOD value of 755.
Any ideas?
anshul
10:28 am on Apr 6, 2005 (gmt 0)
Some PHP script may be doing it runtime, I guesss!
jdMorgan
1:17 pm on Apr 6, 2005 (gmt 0)
This should be easy to find... Just set the directory itself to 555 so that it's not writable. Any attempt to change the settings in that directory will then cause an error, which should be logged. With the information in the log, you should be able to identify the agent that is changing the settings.
Jim
kaianuar
1:37 pm on Apr 6, 2005 (gmt 0)
Unfortunately that directory contains subdirectories that contains data files and they do need to be writable. Will CHMODing the directory to 555 work in this case?
MattyMoose
8:51 am on Apr 7, 2005 (gmt 0)
Well, the case is probably that the owner of that file is changing the perms. Only the owner of it (or root) can change any of the permissions. That tells me that the owner of the script is actually the one changing it (whether that be www or whatever).
a good test may be to change the owner to something else for the moment (some account with no shell -- "nobody" maybe), and leave it as 755. That should stop the script's permissions from changing.