On Fre, 2008-03-28 at 17:27 +0100, Denys Vlasenko wrote:
[...]
> How can root use safely copy a file to user-owned directory?
> 
> Obviously, "cp somefile /home/user/somefile"
>
> What will happen if user created malicious symlink
> /home/user/somefile -> /dev/sda? Should cp STILL write to
> symlink's target despite it being dangerous?

Not necessarily - it could point to some harmless file (still being
owned by that user).

Why not "rm /home/user/somefile" before he "cp" if one absolutely cares?

        Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to