From 04132b7a92eca568639876acc3cfd78d2fe21527 Mon Sep 17 00:00:00 2001 From: Gratien D'haese Date: Mon, 19 Nov 2018 12:34:30 +0100 Subject: [PATCH 1/2] adding carriage return check in usr/sbin/rear #1965 --- etc/rear/local.conf | 19 ++++++++++--------- usr/sbin/rear | 6 +++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/etc/rear/local.conf b/etc/rear/local.conf index 46d1c46d2c..ec783502c8 100644 --- a/etc/rear/local.conf +++ b/etc/rear/local.conf @@ -1,9 +1,10 @@ -# Default is to create Relax-and-Recover rescue media as ISO image -# set OUTPUT to change that -# set BACKUP to activate an automated (backup and) restore of your data -# Possible configuration values can be found in /usr/share/rear/conf/default.conf -# -# This file (local.conf) is intended for manual configuration. For configuration -# through packages and other automated means we recommend creating a new -# file named site.conf next to this file and to leave the local.conf as it is. -# Our packages will never ship with a site.conf. +# Default is to create Relax-and-Recover rescue media as ISO image +# set OUTPUT to change that +# set BACKUP to activate an automated (backup and) restore of your data +# Possible configuration values can be found in /usr/share/rear/conf/default.conf +# +# This file (local.conf) is intended for manual configuration. For configuration +# through packages and other automated means we recommend creating a new +# file named site.conf next to this file and to leave the local.conf as it is. +# Our packages will never ship with a site.conf. +BACKUP=NETFS diff --git a/usr/sbin/rear b/usr/sbin/rear index 9ab5c5548a..e594fd84a9 100755 --- a/usr/sbin/rear +++ b/usr/sbin/rear @@ -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 From 224cb8d8f22b6bafdf1c930cf96f10568b4e3b9c Mon Sep 17 00:00:00 2001 From: Gratien D'haese Date: Mon, 19 Nov 2018 12:39:11 +0100 Subject: [PATCH 2/2] dos2unix to local.conf file again after testing --- etc/rear/local.conf | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/etc/rear/local.conf b/etc/rear/local.conf index ec783502c8..46d1c46d2c 100644 --- a/etc/rear/local.conf +++ b/etc/rear/local.conf @@ -1,10 +1,9 @@ -# Default is to create Relax-and-Recover rescue media as ISO image -# set OUTPUT to change that -# set BACKUP to activate an automated (backup and) restore of your data -# Possible configuration values can be found in /usr/share/rear/conf/default.conf -# -# This file (local.conf) is intended for manual configuration. For configuration -# through packages and other automated means we recommend creating a new -# file named site.conf next to this file and to leave the local.conf as it is. -# Our packages will never ship with a site.conf. -BACKUP=NETFS +# Default is to create Relax-and-Recover rescue media as ISO image +# set OUTPUT to change that +# set BACKUP to activate an automated (backup and) restore of your data +# Possible configuration values can be found in /usr/share/rear/conf/default.conf +# +# This file (local.conf) is intended for manual configuration. For configuration +# through packages and other automated means we recommend creating a new +# file named site.conf next to this file and to leave the local.conf as it is. +# Our packages will never ship with a site.conf.