I am trying to set up a database program so that the only way to change the database is through my program. I thought I had the answer in using the "set user ID to file owner" capacity of chmod ("chmod u+s". I sounds to me from the description I have that when this is set on the program and anyone runs it, it will run as if I were the user and can write to a file for which only I have write-access. Unfortunately, when I have tried to set this up, it does not work. Other users cannot access my file. Can anyone tell me what I am doing wrong, or suggest another method of not allowing access to a file except by a particular program?
Here is a complete description of a test I did of this:
1)Created a file "temp" with junk content.
2)entered "chmod a-r temp", and then "chmod u+r temp", to make sure only I could read the file
3)Created a script "tst" with one line: "cat (path)/temp". (path being the complete path to the file)
4)entered "chmod a+x tst" and "chmod a+s tst"
5)Ran "tst" to confirm that it would display the contents of "temp" for me.
6)I asked another member of my group to run (path)/tst
7)The results for him were:
cat: cannot open (path)/temp
Any ideas?
Here is a complete description of a test I did of this:
1)Created a file "temp" with junk content.
2)entered "chmod a-r temp", and then "chmod u+r temp", to make sure only I could read the file
3)Created a script "tst" with one line: "cat (path)/temp". (path being the complete path to the file)
4)entered "chmod a+x tst" and "chmod a+s tst"
5)Ran "tst" to confirm that it would display the contents of "temp" for me.
6)I asked another member of my group to run (path)/tst
7)The results for him were:
cat: cannot open (path)/temp
Any ideas?