Patch in attachment -- Pierre Ynard
From 33ee6752b8752cedd4cdc3bb936485e3aec14e03 Mon Sep 17 00:00:00 2001 From: Pierre Ynard <linkfa...@yahoo.fr> Date: Thu, 28 Feb 2019 19:16:48 +0100 Subject: [PATCH] Do not use unsafe `: >` shell command to create files (Closes: #923478)
As per POSIX standard and dash implementation, the `:` shell command is a special built-in, whose redirection errors will abort the script. Use `true` instead to handle file write errors gracefully. --- debian/src/initscripts/etc/init.d/bootmisc.sh | 2 +- debian/src/initscripts/lib/init/bootclean.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/src/initscripts/etc/init.d/bootmisc.sh b/debian/src/initscripts/etc/init.d/bootmisc.sh index ad60f2a..06facc2 100755 --- a/debian/src/initscripts/etc/init.d/bootmisc.sh +++ b/debian/src/initscripts/etc/init.d/bootmisc.sh @@ -26,7 +26,7 @@ do_start () { esac # Create /var/run/utmp so we can login. - : > /var/run/utmp + true > /var/run/utmp if grep -q ^utmp: /etc/group then chmod 664 /var/run/utmp diff --git a/debian/src/initscripts/lib/init/bootclean.sh b/debian/src/initscripts/lib/init/bootclean.sh index 553f196..03a593e 100644 --- a/debian/src/initscripts/lib/init/bootclean.sh +++ b/debian/src/initscripts/lib/init/bootclean.sh @@ -19,7 +19,7 @@ mkflagfile() # able to introduce a symlink here. As an extra precaution, # set noclobber. set -o noclobber - :> "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; } + true > "$1" || { log_failure_msg "bootclean: Failure creating '$1'." ; return 1 ; } return 0 } -- 2.1.4