cp: odd behaviour; does not preserve symlink

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Wed Jun 10 18:14:15 UTC 2009


On Tue, 9 Jun 2009, Denys Vlasenko wrote:

> I am not entirely sure that I am right doing do,
> but in this case it's ugly enough that I do disagree.
>
> What do you think? Is it causing compat problems in real life?

It might.  I suppose some people expect the same (sometimes broken)
behaviour as gnu & posix, just because they're the authorities.  And
that's ok, except in this case I do agree with you, but I wouldn't be too
surprized to hear it's a too intrusive change.

> My point, being careful in running, for example, sed .... -i FILE
> and taking care that FILE is not replaced by a malicious symlink,
> is understandable.

Agreed.

> root usually doesn't do that in /home/joe anyway.

Right.

> But when root can't *just copy* a bunch of files to Joe's dir
> without having nightmares about bad boy Joe is... stupid.
> How is root supposed to do such a thing safely then??

Yes.

> cp *can* take care of this. Why it does not?

I must also admit I expected busybox cp to imitate that broken behaviour.

> If people will convince me that this is a real problem for them,
> I will change it. If it's just a crusade for standards...

If noone else opposes the bb-cp behaviour, than it means it's ok.
Moreover, it's now discussed and documented, sort of.


Cheers,

-- 
Cristian


More information about the busybox mailing list