Loading ...
Sorry, an error occurred while loading the content.
 

Re: Doing a chmod on a nfs file using a cgi script

Expand Messages
  • perlmedian
    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
    Message 1 of 3 , May 4, 2004
      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 perl-beginner@yahoogroups.com, <greg.hering@b...> wrote:
      > I get permission denied when trying to chmod a nfs mounted file or
      > directory.
      >
      > 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.
      >
      >
      >
      > Ideas?
      >
      >
      >
      > Thanks.
      >
      [SNIP]
    • Emanuel G Calso
      ... If the server configured your nfs mount to be seen only as nobody it s basically impossible to get around it. Try telnet/ssh - ing your nfs server (the
      Message 2 of 3 , May 5, 2004
        On Wednesday 2004 May 05 01:55, greg.hering@... wrote:
        > I get permission denied when trying to chmod a nfs mounted file or
        > directory.
        >
        > 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.

        If the server configured your nfs mount to be seen only as "nobody" it's
        basically impossible to get around it.
        Try telnet/ssh - ing your nfs server (the one who's serving files) and look
        at /etc/exports
        and check if there's "anonuid", if that's the case. I doubt anyone can help
        you... unless you can edit that file.

        --
        eman calso
        http://www.bloodpet.tk/
        New members are urgently needed in the Society for Prevention of
        Cruelty to Yourself. Apply within.
      Your message has been successfully submitted and would be delivered to recipients shortly.