Page MenuHomeFreeBSD

Fallback to copy if chown/chgrp would land in different filesystems
AbandonedPublic

Authored by cem on Mar 29 2018, 5:05 PM.

Details

Reviewers
bdrewery
brooks
se
bcr
Group Reviewers
manpages
Summary

Add install hardlink mode, -l c, that falls back to copy on EXDEV.

Add prog/progs target, LINKS_OR_COPIES, which implies this installation mode.
(Just in case it should not totally replace LINKS.)

Use that mode for usr.sbin/chown.

Documentation is provided.

Test Plan

This is wholly untested.

Motivated by https://github.com/freebsd/freebsd/pull/133 .

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 15875
Build 15879: arc lint + arc unit

Event Timeline

cem created this revision.Mar 29 2018, 5:05 PM
cem edited the test plan for this revision. (Show Details)Mar 29 2018, 5:06 PM

Out of curiosity, why specifically for chown / chgrp?

cem added a comment.EditedMar 29 2018, 5:35 PM

Out of curiosity, why specifically for chown / chgrp?

They are the observed weird case of being "links" in different directories — usr/sbin for chown, but usr/bin for chgrp. This causes problems for ZFS users who hyper-partition their installation filesystems (in order to set nosetuid+noexec etc by default, but reeanble it for specific directories like /bin, /sbin, and /usr/[s]bin).

For more detail, see the linked github PR.

I'm not a fan of this or the mixed link support, but this seems like an ok solution to the problem. I'd mostly prefer to burn the extra 10k of disk space and do copy all the time.

cem added a comment.Mar 29 2018, 5:44 PM

I'm not a fan of this or the mixed link support, but this seems like an ok solution to the problem. I'd mostly prefer to burn the extra 10k of disk space and do copy all the time.

Copy all the time sounds totally fine to me as well.

bcr accepted this revision.Aug 19 2018, 7:06 PM
bcr added a subscriber: bcr.

Looks good to me from manpages.

This revision is now accepted and ready to land.Aug 19 2018, 7:06 PM
cem abandoned this revision.Sep 28 2019, 9:31 PM

I don't intend to commit this. I don't think it's necessarily a bad idea, I just don't particularly care about it and don't have time to verify (to my own satisfaction) that it doesn't break anything.