source: main/trunk/package-kits/scripts/gs-mkdir/ReadMe@ 29704

Last change on this file since 29704 was 29701, checked in by Jeremy Symon, 9 years ago

Added suid program for creating Greenstone folder in user home folders, and making it accessible by the tomcat group

File size: 1.2 KB
Line 
1This is a suid program for creating greenstone folders in users' home folders.
2It should be owned by root:tomcat, and have the SUID bit set, i.e.
3
4 sudo chown root:tomcat7 ./gs-mkdir
5 sudo chmod u+s ./gs-mkdir
6
7Build with:
8
9 gcc -o gs-mkdir gs-mkdir.c -lacl
10
11When given a valid username, it will create a 'Greenstone' folder in that
12user's home folder, chown it to be owned by that user, and use ACL (Access
13Control Lists) to allow both Tomcat and the given user to read and write files
14in that folder.
15
16In order for Tomcat to access the user's Greenstone folder, it also has to be
17able to traverse the directories leading to it (i.e. /home/<user>/).
18To do this, the executable bit must be set on those directories. The following
19permissions will work:
20
21 drwx--x--x
22
23Explanation:
24The read permission on a directory allows listing the files in that directory.
25The execute permission on a directory allows traversing to a known file in that
26directory (i.e. if a directory is executable, but not readable, you can only
27get to files that you know the name of).
28Since we know the name of the Greenstone folder, we can get to it directly, and
29don't need read permissions on the user's home folder.
Note: See TracBrowser for help on using the repository browser.