Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

msharp

macrumors regular
Original poster
Jul 10, 2004
212
9
Hi there

I'm currently developing a software by PHP with Apache 1.3 that bundled with Mac OS X.

Now I need to launch a graphic program(for example, Photoshop) to open some type of file(in this case, a .psd file)

I tried to run terminal commands like this:
Code:
open -b com.adobe.Photoshop [FilePath]

It worked for me, but it won't work when it's run by PHP(System opens the psd file using Preview).

I guess it's the privilege problem, it seems that the "www" user can not open a file by specifying a bundleIdentifier while a normal user can.

So I'm here asking is there anything I can do about this?

Thanks!~
 

rickb

macrumors newbie
Dec 5, 2006
12
0
How did you find the terminal executable for photoshop, I'm looking for the same thing but for other programs?

THanks
 

jhande

macrumors 6502
Sep 20, 2006
305
0
Denmark
Suexec (a wrapper for setuid, google it) can do what you want. However, be wevy, wevy careful. What you are doing is escalating apaches privileges for this particular script.

If you choose to go this route, then at least be certain that the script that is called is severely restricted. I don't know how Photoshop handles commandline arguments, but if it globs all of them as a sequence, and allows stuff like "photoshop /file/I/want rm -rf /", and 'rm -rf /' is executed, then you've just hosed all the parts you have access to.

Whatever route you choose, make sure that you validate whatever is going to be sent to the system.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.