From 85187a4dbee190478c16657add9a46d64ead9f20 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 12 Jul 2009 12:38:37 -0500 Subject: [PATCH] * byobu: make this script set -e, such that it will fail if byobu-janitor exits non-zero * byobu-janitor: check that ~/.byobu is writable; print an error message and exit non-zero if not; handles odd situation where user launches byobu from a sudo/root shell, and root owns their ~/.byobu dir, but then they launch as non-root sometime later, LP: #394147 Signed-off-by: Dustin Kirkland --- byobu | 2 +- byobu-janitor | 7 +++++++ debian/changelog | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/byobu b/byobu index a7976ea7..6d5895cf 100755 --- a/byobu +++ b/byobu @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e # # byobu - screen wrapper script # Copyright (C) 2008-2009 Canonical Ltd. diff --git a/byobu-janitor b/byobu-janitor index 3e3eea97..65948389 100755 --- a/byobu-janitor +++ b/byobu-janitor @@ -32,6 +32,13 @@ OLDPKG="screen-profiles" DEFAULT_PROFILE="light" PROFILE="$HOME/.$PKG/profile" +# Affects: users who launched using sudo, such that their config dir +# is not writable by them +if [ -d "$HOME/.$PKG" ] && [ ! -w "$HOME/.$PKG" ]; then + echo "ERROR: [$HOME/.$PKG] is not writable by the current user" 1>&2 + exit 1 +fi + # Affects: Upgrades from screen-profiles # If the old config dir exists, but the new one doesn't, provide a migration mechanism. if [ -d "$HOME/.$OLDPKG" ] && [ ! -e "$HOME/.$PKG" ]; then diff --git a/debian/changelog b/debian/changelog index e6cb59d1..e9eeb0db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ byobu (2.20) unreleased; urgency=low + * byobu: make this script set -e, such that it will fail if byobu-janitor + exits non-zero + * byobu-janitor: check that ~/.byobu is writable; print an error message + and exit non-zero if not; handles odd situation where user launches + byobu from a sudo/root shell, and root owns their ~/.byobu dir, but then + they launch as non-root sometime later, LP: #394147 * debian/source_byobu.py: add apport hooks for byobu - -- Dustin Kirkland Thu, 09 Jul 2009 13:31:15 -0500 + -- Dustin Kirkland Sun, 12 Jul 2009 12:36:38 -0500 byobu (2.19-0ubuntu1) karmic; urgency=low