bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp -a behavior change, 4.0p -> 4.1


From: Bob Proulx
Subject: Re: cp -a behavior change, 4.0p -> 4.1
Date: Sat, 2 Nov 2002 18:41:51 -0700
User-agent: Mutt/1.4i

Tim Metz <address@hidden> [2002-10-08 12:17:41 -0700]:
> Greetings:
> 
> I hope address@hidden is the proper place to report this; if it
> is not, perhaps you could point me to the proper contact.

Yes, this is a good place.  Thanks for sending in a report of your
problem.  (In the future bug-coreutils will show up in the same place
that you saw the bug-fileutils.  Saying this just so that you will
expect it.)

And just so I don't forget, thanks for your very well written report.
It is always easier to debug these things when all of the details are
furnished.

> The behavior of "cp -a" seems to have changed from version 4.0p to
> version 4.1. With version 4.0p, "cp -a" would change the ownership of
> the file(s) copied to the user performing the copy.  With version 4.1,
> the ownership change portion of the copy now fails, though the time stamps
> seem to be preserved.  

Hmm...  That seems strange.  As background information you might find
this part of the FAQ pertinent.  Look for the section "Why can only
root chown files?"

  http://www.gnu.org/software/fileutils/doc/faq/

> Steps to replicate the problem are show below.
> 
> System is RedHat Linux 7.2
> Copy is from NFS mounted HPUX vxfs filesystem with standard mount options
> (rw,suid,delaylog,datainlog) to to local ext3 filesystem with default
> mount options.

In an unrelated objection I do not consider suid a standard option but
rather a security hole.  I never use it myself.  I always say nosuid
there.  But that is unrelated to your current problems.  I am
digressing.

HPUX is configurable as to whether chown is restricted to root only or
open for anyone.  The default is legacy mode and to to allow chown by
anyone but can be configured to implement the modern methodology if
desired.  But I think that this is only pertinent if you were writing
files there and not reading them.  Since HPUX NFS is the source I
don't think that is the root cause of the problem.

Linux normally prevents chown unless you are root.  Because of your
data I think your linux system has been reconfigured to allow that.
That is an unusual case.  I believe it is that combination that is
causing this problem.  You are writing to the local linux disk which
has been modified to allow chown and therefore can't chmod after
that.

> address@hidden >/tmp/cp_4.0p -a ~jamals/isscc/slides/talk/* .
> address@hidden >ls -l
> -rw-r--r--   1 tmetz    users        2204 Aug 15  2001 inttalk.aux
> -rw-r--r--   1 tmetz    users       37096 Aug 15  2001 inttalk.dvi
> -rw-r--r--   1 tmetz    users      129232 Aug 15  2001 inttalk.ps
> -rw-r--r--   1 tmetz    users         384 May 10  2001 inttalk.tex

One thing missing here is 'ls -l' of the source files.  But I assume
they are owned by 'jamals' because of the later output.

> address@hidden >/bin/cp -a ~jamals/isscc/slides/talk/* .
> /bin/cp: setting permissions for `./inttalk.aux': Operation not permitted
> /bin/cp: setting permissions for `./inttalk.dvi': Operation not permitted
> /bin/cp: setting permissions for `./inttalk.ps': Operation not permitted
> /bin/cp: setting permissions for `./inttalk.tex': Operation not permitted
> 
> address@hidden >ls -l
> -rw-r--r--   1 jamals   users        2204 Aug 15  2001 inttalk.aux
> -rw-r--r--   1 jamals   users       37096 Aug 15  2001 inttalk.dvi
> -rw-r--r--   1 jamals   users      129232 Aug 15  2001 inttalk.ps
> -rw-r--r--   1 jamals   users         384 May 10  2001 inttalk.tex

I believe the code is running into a case that is unusual.  It chowns
first and that succeeds.  Then it chmods which fails since you are no
longer the owner.  It probably used to do that in the other order
previously.  I will file this as a bug in the system.

Can you verify that you have chown enabled on your local linux disk?

  touch foo
  ls -l foo
  chown jamals
  ls -l foo

As an aside, if so, did you manually configure your system to allow
chown?  I just verified on both a Redhat 6.2 and a 7.2 system that
chown is not allowed by default.  Therefore I suspect that you have
customized your system.  May I ask to what benefit you will be getting
with that configuration?

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]