From nobody Thu Dec 07 20:38:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SmR1t5JtZz53ZP2; Thu, 7 Dec 2023 20:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SmR1t1srYz4tGh; Thu, 7 Dec 2023 20:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701981522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UUZ+O56jN27kfP1JbCZlN19ehBgyaQa7WYnhjhvePNY=; b=pKbgm5n/btYP5uHzsv4ODV5iyNyu7LYZouxw0/JKvifpDeIOFx2YksMwO+U/UQ5/jsvc3S DtRhkhYXmk4h8/goWjiI3jgz4ebd7ZVukz90cSrVjs2kNTCdgR/fBzAHz8t5BPg3BiasGr mqGq2nWp5DesODzqHQy/n8WlcePQX8XJLqNhsADy6b7yI0PBXDi68EZmy3I8D9OYfixFEz /YJCyhxSqisX6T+UhEV+inVtnbXvUGK1Ulk26Qs8NGR3P6XU7ZeDm7uFIU0jnn69Hh1cgw MoyUwP/mGqZSh3ljeDwij8ZBOr3Wvw1oW8JVkYB/MaqXMioe7Bt8JOUqhaBU+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701981522; a=rsa-sha256; cv=none; b=iWu3DYhft4Ypj4hpf9UWifduqHYKr5CGPgAZBR5VDnn9g4TkP/7j42Empjws2Mb1Mj5+RU fmgCEmFvWz9Exlsg9O8WWK/t+aGwlSZxIsEsrzE6evBiy2+G8utoLuzXMiHxytE8gmUjDa UueABpVYuJLiwHIcncBv4MHoWLCvrCkLy6md80AehUpLIPjChJ1mGLLCGlUGyJYkCs4e+F E5C0QJPosuaTkYhFTfPq70J8zfu/fVZQ/N+ZBLH759gcYeD2lXa40OIydU5QBUXMccB/1e h3+cQdRgWnuNNm6fzV6WM/3hCC07N0ue5Dk4B0/wsXcCr6ixvSclHS/wnDGseg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701981522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UUZ+O56jN27kfP1JbCZlN19ehBgyaQa7WYnhjhvePNY=; b=Ed1t7YAJnQBwE9IfkWv+gyQ6JedJBxFY0f7qb4e1dfVk7Qn7WFGxQDTVGT4Qat3Smgrpnt ghcFloK0IIYWYDSF/V5WIMUUkvPvvSbn9jOWyvcreW9zB6wmLrKGt+t9zEPWuxMMSVJCIr e2Pg5tZ9gtVojkRUcgCYG3LNMP5RcQ3c1ZZy95QPDcX2yT1WuiEZc6vCHviAFgxdW38FqM dVzbdCH+I5c4/3Oss8JJ7HqTkFg/K/jKLWCtyoPakBmlMrDodVwFbqt7xKi/xiY8i+U9P6 lXF5/TlFgioy1UFT8D97VjGf8orYWhMFb1Rz8iO+xe5NcTZqhxh+emNhsTYZLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SmR1t0zXRzrYY; Thu, 7 Dec 2023 20:38:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3B7KcghS057911; Thu, 7 Dec 2023 20:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B7KcgGg057908; Thu, 7 Dec 2023 20:38:42 GMT (envelope-from git) Date: Thu, 7 Dec 2023 20:38:42 GMT Message-Id: <202312072038.3B7KcgGg057908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3e7e3b5bdf90 - main - cp: Don't warn for chflags() failing with EOPNOTSUPP if flags == 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e7e3b5bdf902a375decc11b95179fd2fbc0da2a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e7e3b5bdf902a375decc11b95179fd2fbc0da2a commit 3e7e3b5bdf902a375decc11b95179fd2fbc0da2a Author: Warner Losh AuthorDate: 2023-12-07 19:32:30 +0000 Commit: Warner Losh CommitDate: 2023-12-07 20:36:44 +0000 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 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 --- bin/cp/utils.c | 13 +++++++++++-- 1 file 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);