Page MenuHomeFreeBSD

cp: Partly restore symlink folllowing.
Needs ReviewPublic

Authored by des on Wed, Apr 30, 7:13 PM.
Tags
None
Referenced Files
F116010722: D50093.diff
Thu, May 1, 1:46 PM
Unknown Object (File)
Wed, Apr 30, 9:20 PM
Subscribers

Details

Reviewers
None
Group Reviewers
Klara
Summary
  • 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63810
Build 60694: arc lint + arc unit

Event Timeline

des requested review of this revision.Wed, Apr 30, 7:13 PM

The patch doesn't apply to main -- is there a preceding diff?

bin/cp/cp.c
317

This line should be wrapped.