Bug 152398 - cp -p copy with root:other permissions
cp -p copy with root:other permissions
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: coreutils (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-29 04:40 EST by Daniel Moshes
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-31 05:51:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Daniel Moshes 2005-03-29 04:40:03 EST
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 04:59:58 EST
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 05:42:58 EST
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 05:51:32 EST
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.