Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use AppleScripts to generate web pages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use AppleScripts to generate web pages
Authored by: larkost on Dec 22, '03 11:37:03AM

Doing this is definitely a security hazard, for 2 reasons:

If anyone compromises apache in any way, they are now running as your main user, and that means they are running as an administrator... lots of problems there.

Your applescript is also running as your main user, and holes here are identical to the other problem.

A much better solution would be to run the applescript as a CGI. There is a quick example of how to do this is on Apple's web site. The jist of it is a "on handle CGI request this_request" handler. If you absolutely need this script to run as a specific user (SECURITY HOLE), then you can use the setuid bit (man chmod and look at the entries for 4000 and 2000). You can also use this trick to do so in SSI or PHP.



[ Reply to This | # ]
Use AppleScripts to generate web pages
Authored by: Graff on Dec 22, '03 02:27:34PM
A much better solution would be to run the applescript as a CGI. There is a quick example of how to do this is on Apple's web site. The jist of it is a "on handle CGI request this_request" handler.

From what I understand this will only truly work on Mac OS X Server. To do the same thing on regular Mac OS X you need to use something like the program acgi dispatcher.



[ Reply to This | # ]
Use AppleScripts to generate web pages
Authored by: grrl_geek on Dec 23, '03 01:15:48PM

No, you can run CGI scripts on regular OS X, there just isn't a GUI tool to do so. You have to edit httpd.conf by hand, but it's not hard.



[ Reply to This | # ]
Use AppleScripts to generate web pages
Authored by: grrl_geek on Dec 23, '03 01:20:24PM

I'm sorry, I should have looked at your link before commenting. I didn't realize that there were special things to consider with AppleScript.



[ Reply to This | # ]