From nobody Wed May 25 21:22:43 2022 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 468A41B38556; Wed, 25 May 2022 21:22:44 +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 4L7kYc1Vm3z3sKM; Wed, 25 May 2022 21:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653513764; 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=aiVEvEsk2pt51ry4cUVQtreXxzVonPKZ4gDsqeuCKGQ=; b=S3bUVneAyW628bHb/MuFUinPWkDBggpFgwv7PMBVRfI+XNibBVrfu10XkWv+q5VzovD42B f0ePbMVN7Yf9id7buBUx7N17vO4cS0EOixKPt5ryLCuxBygcA91l2nhVP0EkJbrS1ZFxtn m/2k4f+gEYdftAgNYV7ksFwqm3pzItU4oinOxI3K+BlexUZZwpMi7iNTWj4P43g9fBnfSC r7nUFR718fWf09Ob0gT6xiKLSudge8/ygl99OzOC2FnFj7VPqVfHpEhlCWiBB76xp+cszS 5XDZkVd6lLn06cTgMhWWjVteI4PBwCop+Zzu+56iofINgqcTxjPsUun4vK0/mw== 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 1372E21080; Wed, 25 May 2022 21:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24PLMhxc018212; Wed, 25 May 2022 21:22:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24PLMh3Z018211; Wed, 25 May 2022 21:22:43 GMT (envelope-from git) Date: Wed, 25 May 2022 21:22:43 GMT Message-Id: <202205252122.24PLMh3Z018211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f8287caae482 - main - etcupdate: Preserve permissions when installing a resolved file. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8287caae48246e34d6a7af5446df3c36127b7f0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653513764; 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=aiVEvEsk2pt51ry4cUVQtreXxzVonPKZ4gDsqeuCKGQ=; b=J90dSzqBfStuCixSaDFAGcQxOn0mPwFbvDcJf3WTRttxHliSnKCiyhWT9pTfn7q8nhpYNK pfN3iJ74ag2/Yvzmmt0Ad2EEMNLZJwdS1p21Ki+O+eh+lIbm+CLc3actOCnClqFIWeWkvR CCWFpdU012ZUfZ3x5cSoSRHhWkhKfJmZ4zZWxKHrVUQuUWKpzqpWsPePFhcVtJSQLcUn20 ihaZO+cvFLQ3JXnzex9F00x29/OFr9Srhg8MN5C/yYjDwkarExnq97ZYUGgjThDU0L0/yA YCe0g+lhFWU8O88j3jI+A20BmXCbLlbpqCtw5emHLBuwVh+E/5zejyi4mkA8Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653513764; a=rsa-sha256; cv=none; b=q29/HM6gs47v31HghFPXdLcui9E1K61BZAQ4CFFgrIk3SfN03WgxbPt1ks4e9wWsWdrDXc +ALYqz0qDvRyKjeTruYFH90p7Ojb/aB5ktxTAHeQrqa5OcNFSAN0uEH/ww8/JudqjBvpg1 B1hzE8LVMeBUT7GBDEtmNEJZngBdwyCFAo+q50Z6ZCRNbTXBGhVO6CBF1f0b+2t6KzrjIT IlDlMfp4BEpwi02yKl+KKFlLPEI69W75mA5YQ8qpickpRAgNSYw/Z2smBsyZ2IC/+Zea6h Rof7CV/kY7AfIwCj4JRG4mSLR2iUY4AJKp8CD4Evl7NTx/3J+Chjy3AnZEGpvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f8287caae48246e34d6a7af5446df3c36127b7f0 commit f8287caae48246e34d6a7af5446df3c36127b7f0 Author: John Baldwin AuthorDate: 2022-05-25 21:20:40 +0000 Commit: John Baldwin CommitDate: 2022-05-25 21:20:40 +0000 etcupdate: Preserve permissions when installing a resolved file. Similar to the change in 1a04446f088c79cc2cf85fd86e60ebcc228d3075, use cat to overwrite the contents of the existing file rather than cp so that metadata of the existing file such as permissions and ownership is preserved. PR: 255514 Reported by: uqs MFC after: 1 week --- usr.sbin/etcupdate/etcupdate.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 1618fab59fe6..1da8fbf140d9 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -673,8 +673,9 @@ install_resolved() return 1 fi - log "cp -Rp ${CONFLICTS}$1 ${DESTDIR}$1" - cp -Rp ${CONFLICTS}$1 ${DESTDIR}$1 >&3 2>&1 + # Use cat rather than cp to preserve metadata + log "cat ${CONFLICTS}$1 > ${DESTDIR}$1" + cat ${CONFLICTS}$1 > ${DESTDIR}$1 2>&3 post_install_file $1 return 0 }