]> scripts.mit.edu Git - www/raw.git/blob - news/92.mdwn
Import from TextPattern
[www/raw.git] / news / 92.mdwn
1 [[!meta title="CGI scripts will soon require the executable bit"]]
2 If you write custom scripts on scripts.mit.edu, you will need to be
3 aware of an important new requirement: we will soon require the
4 **UNIX executable bit** to be set on your scripts. This affects
5 scripts written in any language other than PHP. This is a standard
6 requirement on UNIX systems, but due to a technical quirk of the
7 original scripts.mit.edu design, it has not been enforced on
8 scripts.mit.edu up to this point. Therefore, you may need to adjust
9 the executable bit on some of your scripts.
10
11 We currently plan to implement this change on Saturday, Nov. 8,
12 2008.
13
14 ## What you need to do
15
16 Make sure that the executable bit is set on any script that will be
17 run on the scripts.mit.edu servers. You can check this on Athena,
18 using a command similar to the following:
19
20     athena% ls -l /mit/andersk/web_scripts
21     -rwxr-xr-x  1    39270 anders     115 2008-03-14 19:11 test.cgi
22     -rw-r--r--  1    39270 anders      79 2008-04-23 22:22 test2.cgi
23
24 The bit to look for is the \91x\92 in the fourth column. In this
25 example, test.cgi has the executable bit set, and test2.cgi does
26 not. You can fix test2.cgi as follows:
27
28     athena% chmod +x /mit/andersk/web_scripts/test2.cgi
29     athena% ls -l /mit/andersk/web_scripts
30     -rwxr-xr-x  1    39270 anders     115 2008-03-14 19:11 test.cgi
31     -rwxr-xr-x  1    39270 anders      79 2008-04-23 22:22 test2.cgi
32
33 ## Version control
34
35 If your custom script is in a version control repository, you may
36 additionally want to ensure that this change to the executable bit
37 is recorded in the repository.
38
39 -   For Subversion, run
40         svn propset svn:executable ON file.cgi
41
42     and then make a commit.
43 -   For CVS, make a forced commit by running:
44         cvs commit -f -m "" file.cgi
45
46 -   Git will automatically detect the change when you git add the
47     file.
48
49 ## Technical details
50
51 In the original scripts.mit.edu design of 2004, the AFS kernel
52 module was modified so that the scripts.mit.edu servers would see
53 every file as having the executable bit turned on. This was
54 necessary because every page\97including static content pages like
55 HTML files and JPG images\97was executed as a CGI script, using the
56 Linux binfmt mechanism. It soon became clear that this mechanism
57 had a fundamental security problem, so it was redesigned, but the
58 AFS patch was kept for backwards compatibility.
59
60 However, the nonstandard semantics of the executable bit have been
61 increasingly interfering with certain applications on
62 scripts.mit.edu, such as the popular Git revision control system.
63 We have therefore decided to disable it after a short transitional
64 period.
65
66 We are collecting logs of scripts that are being executed without a
67 proper executable bit, and we will contact the owners of any
68 affected scripts that we find. If your custom scripts are
69 infrequently accessed, you may need to test them yourself using the
70 directions above.
71
72
73