etcupdate: preserve the metadata of the destination file
authorvangyzen <vangyzen@FreeBSD.org>
Thu, 8 Sep 2016 15:53:49 +0000 (15:53 +0000)
committervangyzen <vangyzen@FreeBSD.org>
Thu, 8 Sep 2016 15:53:49 +0000 (15:53 +0000)
commitac910f73cd1da08d08fcb0d235465537cd85feb2
tree77cab36c57c00e279370d1efbad2557930f29e7a
parent6fc6025343c0b274c2f793f584c6d0ee1e6d02e7
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
usr.sbin/etcupdate/etcupdate.sh