Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for carriage return in {local|site|rescue}.conf files #1969

Merged
merged 2 commits into from
Nov 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion usr/sbin/rear
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,11 @@ for config in "$ARCH" "$OS" \
done
# User configuration files, last thing is to overwrite variables if we are in the rescue system:
for config in site local rescue ; do
test -r "$CONFIG_DIR/$config.conf" && Source "$CONFIG_DIR/$config.conf" || true
if test -r "$CONFIG_DIR/$config.conf" ; then
# Delete all characters except '\r' and error out if the resulting string is not empty:
test "$( tr -d -c '\r' < $CONFIG_DIR/$config.conf )" && Error "Carriage return character in $CONFIG_DIR/$config.conf (perhaps DOS or Mac format)"
Source "$CONFIG_DIR/$config.conf" || true
fi
done
# Finally source additional configuration files if specified on the command line:
if test "$CONFIG_APPEND_FILES" ; then
Expand Down