diff options
| author | Warner Losh <imp@FreeBSD.org> | 2023-12-07 19:32:30 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2023-12-07 20:36:44 +0000 |
| commit | 3e7e3b5bdf902a375decc11b95179fd2fbc0da2a (patch) | |
| tree | fa44b6b3ef048a6bffd5874035ed73bee11d2887 /bin | |
| parent | 5a52e3d00dd5e0209f6fcb1e41b5985191e6f4e7 (diff) | |
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/cp/utils.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 686db13ef0cf..3621c89dd2f2 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -354,8 +354,17 @@ setfile(struct stat *fs, int fd) fchflags(fd, fs->st_flags) : (islink ? lchflags(to.p_path, fs->st_flags) : chflags(to.p_path, fs->st_flags))) { - warn("chflags: %s", to.p_path); - rval = 1; + /* + * 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.) + */ + if (errno != EOPNOTSUPP || fs->st_flags != 0) { + warn("chflags: %s", to.p_path); + rval = 1; + } } return (rval); |
