From 4318180a7c134fc06c83bac550c90c50678550d8 Mon Sep 17 00:00:00 2001 From: Arcitec <38923130+Arcitec@users.noreply.github.com> Date: Sat, 13 May 2023 05:03:55 +0200 Subject: [PATCH] fix: further improve portability of login-profile.sh The `-d ""` check is false on bash and zsh, but there might be some rare shell out there which treats it as "." or similar, so let's guard against that risk by also verifying that `$HOME` is a non-empty string before we check if it's a directory. --- usr/share/ublue-os/firstboot/launcher/login-profile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/share/ublue-os/firstboot/launcher/login-profile.sh b/usr/share/ublue-os/firstboot/launcher/login-profile.sh index f91fd27..dc78e81 100644 --- a/usr/share/ublue-os/firstboot/launcher/login-profile.sh +++ b/usr/share/ublue-os/firstboot/launcher/login-profile.sh @@ -1,5 +1,5 @@ # Only process users with home directories, but skip the "root" user. -if [ "$(id -u)" != "0" ] && [ -d "$HOME" ]; then +if [ "$(id -u)" != "0" ] && [ ! -z "$HOME" ] && [ -d "$HOME" ]; then # Ensure target file exists and is a symlink (not a regular file or dir). if [ ! -L "$HOME"/.config/autostart/ublue-firstboot.desktop ]; then # Remove any leftovers or incorrect (non-link) files with the same name.