Bug 152398 - cp -p copy with root:other permissions
Summary: cp -p copy with root:other permissions
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: coreutils
Version: 3.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-29 09:40 UTC by Daniel Moshes
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-31 10:51:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Moshes 2005-03-29 09:40:03 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

Description of problem:
Hi
I have linux redhat ent 3 . I have an nfs file system which is on netappliance F760.
When as a user I try to operate the command  âcp âpâ of  a files which the owner is root to the netapp nfs, I get the error:
 âcp: setting permissions for `./hosts': Operation not permittedâ.
A file is created but it is with ownership of root and group other.

See example:
dmoshes@lsis ~]$ cp -p /etc/hosts .
cp: setting permissions for `./hosts': Operation not permitted
[dmoshes@lsis ~]$ ls -l hosts
-rw-r--r--    1 root     root          458 Jan 26 15:45 hosts

Please assist.


Version-Release number of selected component (if applicable):
coreutils-4.5.3-26

How reproducible:
Always

Steps to Reproduce:
1.login to a system as a user foo from group boo which is not root
2.check that it has a netapp nfs file system
3.copy a file owned by the root to the netapp nfs file system with "cp -p"
  

Actual Results:  I get the error:
 âcp: setting permissions for `./hosts': Operation not permittedâ.
A file is created but it is with ownership of root and group other.


Expected Results:  It should not give error notice and copy the file with the ownership of the user foo  and group boo .

Additional info:

I have tried to upgrade core utills and it didn't work.

Comment 2 Tim Waugh 2005-03-31 09:59:58 UTC
You cannot set file ownership to root as a user.  I think the -p option will do
what you expect if you run cp as root.

Comment 3 Daniel Moshes 2005-03-31 10:42:58 UTC
Hi
This command should work when a user is operating it.It is users who are 
working.they cannot work as root.The direction of problem is to the kernel or 
the coreutils rpm I think.

Comment 4 Tim Waugh 2005-03-31 10:51:32 UTC
The command cannot work when a user is operating it, because users cannot
arbitrarily set file ownership -- otherwise there would be no point in storing
file ownerships in the first instance, since they could all be overridden.



Note You need to log in before you can comment on or make changes to this bug.