Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 3 product line. The current stable release is 3.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 152398

Summary: cp -p copy with root:other permissions
Product: Red Hat Enterprise Linux 3 Reporter: Daniel Moshes <daniel.moshes>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: shillman
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-31 10:51:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.