[Zope] os.system in external method

Philippe Jadin philippe@123piano.com
Fri, 17 Aug 2001 11:42:09 +0200


Hello,

I'm trying to execute an external command from an external method. 
Altough it works when I do it from the python console, like :

$ python

 >>> import os
 >>> os.system("/usr/local/zope/instance/var/images/jpeg2swf ABALONE.JPG 
out.swf")

It works and return 0 (under both root and my user account). btw I 
cannot 'su nobody' (user currently not available) for testing this as 
nobody.

Fine.

But when I try this in an external method from zope, like this :

def execute(self):
 import os
 return os.system("/usr/local/zope/instance/var/images/jpeg2swf 
ABALONE.JPG out.swf")

It returns a number : 64768 ("error code fomr the command ?)

I guess it's because zope runs under nobody or something like that, but 
I'm not sure...

Do you think there are differences between external methods and the 
python console beside the user running it? If not, how could I force 
zope to run my command as another user?

I'm on freebsd.

BTW, the jpeg2swf command is chmod 777 for testing purpose.

What would you do ?

Thanks !

Philippe