HomeFreeBSD

cp: Partly restore symlink folllowing.

Description

cp: Partly restore symlink folllowing.

  • As a general rule, follow symbolic links in the destination as long as the target is within the destination hierarchy.
  • As a special case, allow the destination itself to be a symbolic link, and even a dead one (in which case we create the target).
  • The file-to-file case remains unrestricted.

Currently, if a symlink we aren't allowed to follow is encountered,
cp will behave just like it would if the file was not writable. We
should consider whether it would be better to replace the offending
link instead.

Fixes: 0729d1e8fd90
MFC after: never
Relnotes: yes
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50093

Details

Provenance
desAuthored on May 6 2025, 5:11 PM
Reviewer
markj
Differential Revision
D50093: cp: Partly restore symlink folllowing.
Parents
rG52c8e24cc03b: cross-build: Provide real fflagstostr/strtofflags on Linux
Branches
Unknown
Tags
Unknown

Event Timeline