> -----Original Message----- > From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 08, 2004 3:25 PM > To: [EMAIL PROTECTED] > Subject: Re: Write to file with shared server certificate > > > Ron Goral wrote: > > chmod 0666 is the right thing. Thank you. However, I am not able > > to do that programmatically when the script is running in secure > > mode. The following dies: > > > > $file_path = qq[/usr/wwws/htdocs/mydomain/cgi-bin/logs/errs.log]; > > chmod 0666,$file_path or die "Cannot chmod $file_path - $!"; > > > > However, in "unsecure" mode, this succeeds: > > > > $file_path = qq[/home/username/mydomain-www/cgi-bin/logs/errs.log]; > > chmod 0666,$file_path or die "Cannot chmod $file_path - $!"; > > That's another problem. Note that this is getting rather off topic for > a Perl list. > > I was assuming that you simply could change the permissions when > logged in via FTP or SSH. To do it via a CGI script, the file must be > owned by the user CGI is run as, i.e. the file typically needs to have > been created by the script. Is that the case? > > Still assuming that we are talking about 'physically' the same file, > i.e. that /usr/wwws/htdocs/mydomain is a symlink to > /home/username/mydomain-www, I really don't know why the first example > above dies. What does the error log say? > > Can it possibly be that CGI is running as a different user under HTTPS > compared to HTTP? > > But again, this is *very* off topic here. > > -- > Gunnar Hjalmarsson > Email: http://www.gunnar.cc/cgi-bin/contact.pl >
Sorry for the off-topic. I had not meant to do that. But..... When trying to chmod, the error message is: Operation not permitted at /usr/wwws/htdocs/mydomain/cgi-bin/test.cgi line 34. If I try to create the file using open(LOG,"+>>$logfile), the error is: No such file or directory at /usr/wwws/htdocs/mydomain/cgi-bin/test.cgi line 35. I am unable to raise the $ENV{USER_NAME} in this environment. However, given that this is a shared server certificate and mine is not the only website on the server, it probably is the case that it is a different user. I will have to contact my host and determine what, if anything, I can do about that. Again, I apologize for posting off topic. Ron Goral -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>