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(
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
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))
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,
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
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