From nobody Wed Jul 13 18:01:28 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 38F391D041ED; Wed, 13 Jul 2022 18:01:29 +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 4Ljlmn18f1z3pHs; Wed, 13 Jul 2022 18:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657735289; 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=WqSuhAZhoeG3iI3uRtHbYTnxZ91z6w5WtbwqwmBpeMg=; b=BcN+lWnHrsEzDSKyaEb/dugwkDhyEAUVa3K50vJ5T5oti0BI82wIAfjtiboaiNA4yKIdCs mSQOzrW2djFdA2VoNpBUSMN9K7cnQgsl+F/vSxScXCkgCfCPvJ80NGwU1dCtXczZAOFLvN fOfa1hIVaKCY76599uo73LT9KfFCM6Ui4TwEe3qhDY/wXT+6Ha1bw+tIE1UGCETj4GSeIy EAzEyOxCjdnvAh1JXAM2NTGvGfNPb64r3J5IyJjdmewkMbQNfecZdmSzZKBoWiCUcwC/VJ +B53HhlGM1uf02OmOs8id75ZDdBMZYnE5AjJ2sTFZ+OsskMbfIFlXp2hFJiR0A== 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 4Ljlmn0FWLzYjB; Wed, 13 Jul 2022 18:01:29 +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 26DI1SP3059129; Wed, 13 Jul 2022 18:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DI1SiQ059128; Wed, 13 Jul 2022 18:01:28 GMT (envelope-from git) Date: Wed, 13 Jul 2022 18:01:28 GMT Message-Id: <202207131801.26DI1SiQ059128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8660d530f72f - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8660d530f72f4103add7487db56b941e6297a8cc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657735289; 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=WqSuhAZhoeG3iI3uRtHbYTnxZ91z6w5WtbwqwmBpeMg=; b=n583uT2d0smA9kKbxWEiB0S50gdK7xbZNX40Pt06NR+4assOTfDhJF/TGyHVlEzMMfXcIq LmgJrXbysjYLe9m3RHJmhgcrOlKtTg3ED44Jdu56Hm6rMmk7fTPzy+D1DsoYQ7/qfIf/Ai 28GHebecb4rDRh/32j9U1+Y/t+hRzUDsWcvh+gGRJxQQbjCNMU3xuZLthpFy5fj3KiDCda T/tbJ/a9snoT3R2/cfEicpXXZEVLN3kPAJ/QFd2WBnibF9JW05fhDLoK1nRFJ4/1D6/Sqk J5zYOwGml3frhNicG9CHUmWrqMYzT+u7F0sLaPIUOBi4vgYAUls9b4lo8cU/oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657735289; a=rsa-sha256; cv=none; b=sBzCL1F5p3iKp44hnYbVVQ3QgK43CK74Nd5kAdde58bXb48Ddx/LJYjAXUMFaQrl1Vh9NB 95EacZjGBXqK2HyEbNLDQe5EekjAvnq4z6k5f6FE53q782qfCTOaelv9Bi7stdgc5WqV43 Z37vqDd4YG5nIAwY4T67bRPVIUFUtBZVhskB9cRaPEOaQaTJJ6AujY0QEXTuhzcKJGn+4v 7/jJncnSXqIzySAITvPMpzPjTbF9XC2Argw/PhKCQDO4JlcNYMFtggWy1ce55/xFpWyc// 57WDRog9vDgN+FzHLt6EGDHROI5KVf71ttv5mPy7P0Zdm3GyxKPz/L7s+Lawng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8660d530f72f4103add7487db56b941e6297a8cc commit 8660d530f72f4103add7487db56b941e6297a8cc Author: John Baldwin AuthorDate: 2022-05-25 21:20:40 +0000 Commit: John Baldwin CommitDate: 2022-07-13 18:00:50 +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 (cherry picked from commit f8287caae48246e34d6a7af5446df3c36127b7f0) --- 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 b686db7d9f9a..e0223123aae2 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 }