mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 23:02:02 -04:00
etcupdate: preserve the metadata of the destination file
When using diff3 to perform a three-way merge, etcupdate lost the destination file's metadata. The metadata from the temporary file were used instead. This was unpleasant for rc.d scripts, which require execute permission. Use "cat >" to overwrite the destination file's contents while preserving its metadata. Reviewed by: bapt Sponsored by: Dell Technologies Differential Revision: https://reviews.freebsd.org/D7817
This commit is contained in:
parent
a6be469014
commit
1a04446f08
1 changed files with 3 additions and 1 deletions
|
|
@ -824,7 +824,9 @@ merge_file()
|
|||
if [ -z "$dryrun" ]; then
|
||||
temp=$(mktemp -t etcupdate)
|
||||
diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > ${temp}
|
||||
mv -f ${temp} ${DESTDIR}$1
|
||||
# Use "cat >" to preserve metadata.
|
||||
cat ${temp} > ${DESTDIR}$1
|
||||
rm -f ${temp}
|
||||
fi
|
||||
post_install_file $1
|
||||
echo " M $1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue