diff options
author | Manoj Srivastava <srivasta@debian.org> | 2020-05-20 22:51:43 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2020-05-20 22:51:43 -0700 |
commit | bcc6ff48c49dcbc1b9156a414bf37ffe7d77ae3d (patch) | |
tree | 345557f5571bebe6a33f349c4e5042725ba397de /ucf | |
parent | 1d1b5e2744d895c1198716a9fab819b281b3a758 (diff) |
bug(perm): ucf set permissions if destination file does not exist
while ucf should not alter the attributes of the file if the
destination exists (the maintainer can do anythjing she wants after
ucf is done), when there is no destination copy the permissions from
the source.
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'ucf')
-rwxr-xr-x | ucf | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -303,8 +303,13 @@ replace_conf_file () { $action cp -pf $selinux "${real_file}" "${real_file}.${OLD_SUFFIX}" fi fi - # Do not change the permissions and attributes of the destination - $action cp -f $selinux "$new_file" "${real_file}" + if [ -e "${real_file}" ]; then + # Do not change the permissions and attributes of the destination + $action cp -f $selinux "$new_file" "${real_file}" + else + # No destination file exists + $action cp -pf $selinux "$new_file" "${real_file}" + fi replace_md5sum; } |