[Tutor] cgi script writing a file: permission denied,
but only sometimes!
Barnaby Scott
barnabydscott at yahoo.com
Mon Aug 2 17:41:17 CEST 2004
I have a problem with a cgi script, which seems to
work for nearly everyone (including me), but for one
person at least does not.
The fragment of code invloved is below: Obviously
there is a lot more, but it is the line with
file(...).write(...) in it which is not being exectued
and is giving Errno 13: Permission Denied.
def save(self):
assert os.getenv('REQUEST_METHOD') == 'POST',
'only POST allowed'
assert self.existcode != 2, 'Cannot save a
rival version of an automatic page'
newtext = getattr(self, 'newtext', '')
if not newtext:
return self.delete()
elif newtext != self.gettext():
self.backup()
file(self.textfile,'w').write(newtext)
return self.resend(message='Thank you for
your update')
else:
return self.resend()
The file in question has permissions rw-r--r--, and
because the script is running as the owner, this
normally works.
The script is called by a SSI tag.
This problem may be beyond the scope of this list, but
does anyone have any suggestions even where to START
looking for a cause? Why would this work in 99% of
cases but for one particular web user not work?
Any clues gratefully received.
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
More information about the Tutor
mailing list