mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 01:01:06 +00:00
etcupdate: Preserve permissions when installing a resolved file.
Similar to the change in1a04446f08
, 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 commitf8287caae4
)
This commit is contained in:
parent
5d7b7a98e5
commit
8660d530f7
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue