HomeFreeBSD

cp: Add -N flag, inspired by NetBSD's similar flag

Description

cp: Add -N flag, inspired by NetBSD's similar flag

Add -N to supress copying of file flags when -p is specified (explicitly
or implicitly). Often times we don't care about the flags or wish to be
able to copy to NFS, and this comes in handy for that. FreeBSD's and
NetBSD's cp are somewhat different, so I had to reimplement all but one
of the patch hunks...

Obtained from: NetBSD (cp.1 1.25, cp.c 1.37, utils.c 1.28 by elad)
Sponsored by: Netflix

Differential Revision: https://reviews.freebsd.org/D42673

(cherry picked from commit 5a52e3d00dd5e0209f6fcb1e41b5985191e6f4e7)

cp: Don't warn for chflags() failing with EOPNOTSUPP if flags == 0

From NetBSD's utils.c 1.5 importing importing BSDI change, with light
formatting changes:

Author: cgd <cgd@NetBSD.org>
Date:   Wed Feb 26 14:40:51 1997 +0000

Patch from BSDI (via Keith Bostic):
>NFS doesn't support chflags; ignore errors unless there's reason
>to believe we're losing bits.  (Note, this still won't be right
>if the server supports flags and we were trying to *remove* flags
>on a file that we copied, i.e., that we didn't create.)

CVS Info: utils.c 1.6

Obtained from: NetBSD
Sponsored by: Netflix

Differential Revision: https://reviews.freebsd.org/D42674

(cherry picked from commit 3e7e3b5bdf902a375decc11b95179fd2fbc0da2a)

Details

Provenance
impAuthored on Dec 7 2023, 7:32 PM
desCommitted on Jan 17 2024, 6:28 PM
Differential Revision
D42673: cp: Add -N flag, inspired by NetBSD's similar flag
Parents
rGbde22cf630ab: dtrace tests: Diff expected and actual output upon a miscompare
Branches
Unknown
Tags
Unknown