Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

We are running RedHat Enterprise ES 5 on x86_64. We have a perl script which does, amongst other things:

  • make a directory
  • copy dot files into it
  • chown the whole thing

The target directory is an automounted directory, which actually comes off the same thing.

If we do this as a shell script, it works:

mkdir /net/host/drive/directory/new
cp /some/stuff/.??* /net/host/drive/directory/new
chown -R user:group /net/host/drive/directory/new

If we do this in a perl script, either as system() or back-ticks, we get "operation not permitted".

This script works perfectly on Solaris which is where it came from.

The script is run as root, not with any su- or setuid going on.

Anyone have any ideas what is going on?

share|improve this question
    
Can we get this post deleted? We don't have access to the box in question any more, so testing possible solutions isn't possible. –  David Mackintosh Sep 8 '09 at 18:19
    
@John no I can't, it says "too many exiting answers or upvoted/accepted answers". –  David Mackintosh Oct 18 '10 at 6:13
add comment

1 Answer

I will go on a limb here and speculate that you probably have that filesystem mounted as NFS with root-squash. This is a security feature, because otherwise anyone with physical access to the network and read mount access to the exported file system could then, with root access on the client machine, access any file on that filesystem.

If you really want root on the client machines to have root privileges on the exported filesystem, the you should export the filesystem with the "no root squash" option.

See this example. Note that the default value of that option on your NFS server implementation might be to root-squash, so you should double check that documentation.

share|improve this answer
    
Good guess, but no -- it is exported no_root_squash. Besides, it wouldn't explain why the shell script works and the perl script doesn't. –  David Mackintosh Jul 20 '09 at 12:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.