From nobody Wed Jul 13 18:01:35 2022 X-Original-To: dev-commits-src-branches@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 008331D04691; Wed, 13 Jul 2022 18:01:35 +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 4Ljlmv5JHqz3pNV; Wed, 13 Jul 2022 18:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657735295; 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=UXsqSC91lq42Hk5mbqPMGGl071cJ3Ew5SE/4bXoeZQc=; b=UEJWHedYundr/IbVdSMsINGdeUgqEqr937R3nvrN4E1tZgfZTcMIsd9Mb4A9GhpuNVMMuF EaDsobZxLrAJia4Bmu77OtHjVj64hbkxxMb0BSSYSY4kocw9Bvpb4vm8CkHyNw689dmy20 3JFyhlmNyDascugu2sSTvVoCxvn7wy0v3dcGqfEQ5Oluqyon/ZyMQL8c3Bu4EyH6pZQNp5 lAMcKC2MrhbmO9BgOAMhrrxp5RmIFV5OU6chUloD2MBTFRpH8LAUIDhIqhkg+Dm/ugiPJ2 ZwRYglO5drVja3j2da5bjg3fmyVnXrHuWGTZ6fYUF3sDNpybgqGG6XkT+ruTSg== 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 4Ljlmv4NV5zYSy; Wed, 13 Jul 2022 18:01:35 +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 26DI1ZCM059297; Wed, 13 Jul 2022 18:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DI1Zg7059296; Wed, 13 Jul 2022 18:01:35 GMT (envelope-from git) Date: Wed, 13 Jul 2022 18:01:35 GMT Message-Id: <202207131801.26DI1Zg7059296@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: 101639e97886 - stable/12 - etcupdate: Preserve permissions when installing a resolved file. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/12 X-Git-Reftype: branch X-Git-Commit: 101639e978868b996dca4309800133eb93605e85 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657735295; 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=UXsqSC91lq42Hk5mbqPMGGl071cJ3Ew5SE/4bXoeZQc=; b=LULBpe2h4Dg4tQEG53qcfka62hSsyMwe6z27CQCJw5qCPO7uDaoB4OIqjKtsHXzR7RHEja 6aiks6obxazDSZ5QBE+RYeQERAUCR4M9iiAmGB1RovqMx4cdA/aivE2oETE0/bRZEF8cFC Z9nLZXQHg72BR4QTIsGx1A4J5fJb/LsIrWLiuHz25q07djRUvxIiN3HE9zDZXCH9j1a6DT dmcT+PY4VmCj+Ia5XVXzDqZX45JmY0yXVYDAVLU882qpWvIMaveQgZn6MDMxaqXm0c0hjN cfnwuyS4INvFgcXJoL1T7Jy20IHJrmGSM6ZYwYlcE7PhG0U+++jnr9cj9qzR/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657735295; a=rsa-sha256; cv=none; b=LL/xQM3DG14fyrbV+BroWyMo6555AfPuZBZPJqKRCz3w5p5dvRt3DZXFaGxibVd88rYPm2 sm5CUX9bcGwRy5yb8kp3oGT/q282+a5os+Z9lzhZI9zjdEgcRP0NCvGaP6bytYkCCNLN0l kkO+ATO8wSJrZoox8jU1Fei2H5CPIjQirYTiJm8HOH9SEGYMta8JHB1P9NqzFHJktKoCuy Xb6uw+dAJdQs+CmfvuGeqp6mYc0OnOjba4/uDMwruxA5BGYI7DUbQem9ofzSnBSskxw8h8 GzbuUGUAi0gSJX92n3DDSP98hYATWZweWyAh2gOBzDUGiNjBimqC5Rj5r8lDbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=101639e978868b996dca4309800133eb93605e85 commit 101639e978868b996dca4309800133eb93605e85 Author: John Baldwin AuthorDate: 2022-05-25 21:20:40 +0000 Commit: John Baldwin CommitDate: 2022-07-13 18:01:08 +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 3715dea7e95c..c2efcd565fa1 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 }