Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion usr/libexec/security-misc/virusforget#security-misc-shared
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ parse_cmd_options() {
exit 1
fi
if ! id -u "$user_name" >/dev/null 2>&1; then
echo "ERROR: User '$user_name' does not appear to exist!"
echo "ERROR: User '$user_name' does not appear to exist!" >&2
exit 1
fi
}

Expand Down Expand Up @@ -297,6 +298,13 @@ unexpected_file() {
}

restore_file() {
## An extraneous file has no baseline backup to restore from; the caller
## has already removed it, which is the correct action. Return early so the
## 'cp' below does not fail on the missing backup and abort the entire
## '--clean' run (via 'set -e') on the first extraneous file encountered.
if [ ! -e "$full_path_backup" ]; then
return 0
fi
if [ "$test_mode" = "true" ]; then
echo "Simulate restoring file... $full_path_original" >&2
echo cp --no-dereference --archive "$full_path_backup" "$full_path_original"
Expand Down