From 8c6910583b5d42c11ee3ab23cc758c7a52a8aa73 Mon Sep 17 00:00:00 2001 From: Marcos Mello Date: Thu, 5 Mar 2020 07:34:47 -0300 Subject: [PATCH] Add rootshell boot option chsh does input validation. Fixes fdupoux/sysresccd-src#77 --- airootfs/etc/systemd/scripts/sysresccd-initialize | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/airootfs/etc/systemd/scripts/sysresccd-initialize b/airootfs/etc/systemd/scripts/sysresccd-initialize index e086c9a..045f695 100755 --- a/airootfs/etc/systemd/scripts/sysresccd-initialize +++ b/airootfs/etc/systemd/scripts/sysresccd-initialize @@ -12,6 +12,12 @@ do SETKMAP=$(echo "${curopt}" | cut -f2 -d=) localectl set-keymap ${SETKMAP} ;; + # Configure root login shell if requested in the boot command line + rootshell\=*) + echo "Found option '${curopt}' on the boot command line" + ROOTSHELL=$(echo "${curopt}" | cut -f2 -d=) + chsh --shell ${ROOTSHELL} root + ;; # Set the system root password from a clear password rootpass\=*) SSHPASS1=$(echo "${curopt}" | cut -f2 -d=)