Re: Delete a file from a CGI

2007-06-04 Thread Steve Holden
Matias Surdi wrote: > Steve Holden escribió: > >> Matias Surdi wrote: >>> Thanks for your reply. >>> >>> This is the code that creates the file: >>> lock_file = open(".lock","w") >>> lock_file.write("test") >>> lock_file.close() >>> #Change permissions so that CGI can write lock file >>> os.chmod(

Re: Delete a file from a CGI

2007-06-02 Thread Matias Surdi
Steve Holden escribió: > Matias Surdi wrote: >> Thanks for your reply. >> >> This is the code that creates the file: >> lock_file = open(".lock","w") >> lock_file.write("test") >> lock_file.close() >> #Change permissions so that CGI can write lock file >> os.chmod(".lock",stat.S_IMODE(stat.S_IRWX

Re: Delete a file from a CGI

2007-06-01 Thread Steve Holden
Matias Surdi wrote: > Thanks for your reply. > > This is the code that creates the file: > lock_file = open(".lock","w") > lock_file.write("test") > lock_file.close() > #Change permissions so that CGI can write lock file > os.chmod(".lock",stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG))

Re: Delete a file from a CGI

2007-06-01 Thread Matias Surdi
Thanks for your reply. This is the code that creates the file: lock_file = open(".lock","w") lock_file.write("test") lock_file.close() #Change permissions so that CGI can write lock file os.chmod(".lock",stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG)) This script was run as root. Now,

Re: Delete a file from a CGI

2007-06-01 Thread Gerardo Herzig
When you execute a cgi, the program runs under the "apache user" (ussualy www or wwwrun or so), so THAT user needs permissions for deleting the file. Other approach could be suid'ing the cgi program. Gerardo >HI! > >I want to delete a file from a CGI, but I always get a Permission denied >error

Re: Delete a file from a CGI

2007-06-01 Thread Steve Holden
Matias Surdi wrote: > HI! > > I want to delete a file from a CGI, but I always get a Permission denied > error. > > I've tryed this after creating the file (from a normal script): > > os.chmod(".lock",stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG)) > os.chown(".lock",pwd.getpwnam("nobo