[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] File ownership?
- Subject: Re: [cobalt-users] File ownership?
- From: "PageKeeper Service" <host@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed Dec 18 08:59:01 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
> Hi All,
>
> I have a PHP script that writes the output of a form to a csv file.
> The customer then goes to an address and downloads the text file to import
> into their system
> They then run a little Perl script from the browser to purge the order
file
> The Perl script looks like this:
>
> #!/usr/bin/perl --
> rename ("/home/sites/site95/web/aformmail-1.1/email.txt",
> "/home/sites/site95/web/aformmail-1.1/email.old");
> system("cp",
> "/home/sites/site95/web/aformmail-1.1/empty.txt","/home/sites/site9
> 5/web/aformmail-1.1/email.txt");
> print "Content-type: text/html\n\n";
> print qq!
> <html><body><H1>Brochure Request File Purged\!</h1></body></html>!;
>
> The problem is that when it copies the empty file to the live file it does
> so with the wrong permissions. I have tried putting in a
system("chmod"...)
> command to set them back but this doesn't work. I think this is a file
> ownership problem.
>
> Can anyone throw any light on this or suggest a better way of doing it.
The
> PHP script that writes the file needs to have 777 permissions. At the
> moment the customer calls me, tells me that he's purged the file. I then
go
> in and manually chmod it or else visitors see a Internal server error when
> they submit the form.
>
> Cheers,
>
> Andy
> ---
Does it run under a user or httpd? If it runs under httpd or nobody make a
script to change the permissions run by that
user or system or both (chown chmod). eg: SSL... Or unlink the file and make
a new one each time.
Thought using a system(fork) in a perl script was a big bozo no-no... at
least in that example it could be.
If it is using ssl make sure your using that url to purge from.. vs. a non
https one that may of wrote the file last under httpd.
And then trying to do something to the file via http.
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
>