RE: [PBML] Re: Doing a chmod on a nfs file using a cgi script
- Dear Nik,
The whole purpose of this is to parse the stderr when root does it, i.e. directory or file is actually missing and I need to go in as root and make a directory or something.
I think I can use I/O redirection to get stderr, but I'm stopped for now at 'permission denied' just doing the chmod.
I tried to make the script, owned by root, run as root by changing the permissions to 4755 but it didn't seem to make any difference. I was watching 'top' in one window and then hit the script with the browser and 'nobody' was still running my validate.cgi script after the change.
There is a better definition of the problem under the subject line:
SUID or Daemon? or?
posted Friday, but I didn't post any code so I guess everyone though I was wishful thinking and didn't reply.
I think I should probably try to do the 'daemon' idea but that's a whole other project and I was doing a bit of wishful thinking myself (wishing there was another way without the daemon!).
From: perlmedian [mailto:perlmedian@...]
Sent: Tuesday, May 04, 2004 12:28 PM
Subject: [PBML] Re: Doing a chmod on a nfs file using a cgi script
Can't help you on the permission problem but if you are using a CGI
script you should have a "use CGI::Carp 'fatalsToBrowser';" to get
your STDERR to come out to the browser. (You can capture STDERR
otherways also if you want to parse first then print). TWIMTOWTDI.
For the permission problem, only the owner of the file can chmod it
(or root). So either the file owner has to change or user running the
script has to change. Just curious what/why are you trying to change
permissions? Perhaps there is another way around the problem.
Sorry couldn't help more,
Perl Median (Nik)
Perhaps someone else has more input.
--- In email@example.com, <greg.hering@b...> wrote:
> I get permission denied when trying to chmod a nfs mounted file or
> I know I'm running as 'nobody' and that's the problem but what can I do?
> I'm in a closed network and I could run the web server as root but I'd
> rather change my code than the machine. The chmod is hard coded in the
> Perl script and there are no execs of unknown code so it's pretty safe
> anyway. The script is owned by root so someone would have to gain root
> access to modify it.
> I want to capture stderr and print it on the web page I'm generating so
> I can see who's setup wrong.
> I tried changing this script to 4755 and the owner is root but that
> didn't help.
Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
Yahoo! Groups Sponsor
Yahoo! Groups Links
* To visit your group on the web, go to:
* To unsubscribe from this group, send an email to:
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.