From 05591ab13defd40c6f4f638010f9f04def3751fd Mon Sep 17 00:00:00 2001 From: Jonathon Fernyhough Date: Tue, 30 Nov 2021 10:47:08 +0000 Subject: [PATCH] Extend home directory ownership test for non-standard setups Various networked environments exist where a user's home directory is not owned by that user. With this patch Byobu checks ownership of .profile too, as a default inclusion of /etc/skel. --- usr/bin/byobu.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/bin/byobu.in b/usr/bin/byobu.in index cf7fd55f..93f7d99c 100755 --- a/usr/bin/byobu.in +++ b/usr/bin/byobu.in @@ -24,8 +24,8 @@ PKG="byobu" # All sorts of things go wrong if you don't own your $HOME dir. # This happens under sudo, if you don't use the -H option; Byobu will # create a bunch of files in your $HOME which will be owned by root. -if [ ! -O "$HOME" ]; then - echo "Cannot run $PKG because [$USER] does not own [$HOME]" 1>&2 +if [ ! -O "$HOME" ] && [ ! -O "$HOME/.profile" ]; then + echo "Cannot run $PKG because [$USER] does not own [$HOME] or [$HOME/.profile]" 1>&2 if [ -n "$SUDO_USER" ]; then echo "To run $PKG under sudo, you MUST use 'sudo -H'" 1>&2 fi