mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-20 05:23:20 -07:00
* usr/bin/byobu, usr/bin/byobu-launch, usr/bin/byobu-launcher,
usr/share/man/man1/byobu.1: LP: #835152 - fix a suite of support issues around launching byobu under sudo, where files/dirs would be created under the $SUDO_USER's $HOME, but would be owned by root
This commit is contained in:
parent
ea544b7a2e
commit
75ee3f7480
5 changed files with 43 additions and 22 deletions
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -2,6 +2,11 @@ byobu (4.32) unreleased; urgency=low
|
||||||
|
|
||||||
* usr/bin/byobu-launcher: LP: #835130
|
* usr/bin/byobu-launcher: LP: #835130
|
||||||
- silence message that some users found noisy
|
- silence message that some users found noisy
|
||||||
|
* usr/bin/byobu, usr/bin/byobu-launch, usr/bin/byobu-launcher,
|
||||||
|
usr/share/man/man1/byobu.1: LP: #835152
|
||||||
|
- fix a suite of support issues around launching byobu under sudo,
|
||||||
|
where files/dirs would be created under the $SUDO_USER's $HOME,
|
||||||
|
but would be owned by root
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 23 Aug 2011 23:23:49 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 23 Aug 2011 23:23:49 -0500
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,19 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
VERSION=4.32
|
VERSION=4.32
|
||||||
|
|
||||||
PKG="byobu"
|
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 [ -n "$SUDO_USER" ]; then
|
||||||
|
echo "To run $PKG under sudo, you MUST use 'sudo -H'" 1>&2
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
|
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
|
||||||
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
|
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
# $HOME/.bashrc: export LC_BYOBU=0
|
# $HOME/.bashrc: export LC_BYOBU=0
|
||||||
# or edit your sshd_config, ssh_config, and set:
|
# or edit your sshd_config, ssh_config, and set:
|
||||||
# $HOME/.bashrc: export BYOBU_DISABLE=1
|
# $HOME/.bashrc: export BYOBU_DISABLE=1
|
||||||
if [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_DISABLE" != "1" ]; then
|
if [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_DISABLE" != "1" ] && [ -O "$HOME" ]; then
|
||||||
BYOBU_SOURCED_PROFILE=1
|
BYOBU_SOURCED_PROFILE=1
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
|
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
|
||||||
|
|
|
@ -18,26 +18,29 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
|
# Bad things happen if you run byobu, but you don't own your $HOME
|
||||||
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
|
# ie, rather than "sudo byobu", you must run "sudo -H byobu"
|
||||||
|
if [ -O "$HOME" ]; then
|
||||||
if [ -e "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then
|
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
|
||||||
false
|
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
|
||||||
else
|
if [ -e "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then
|
||||||
case "$TERM" in
|
false
|
||||||
*screen*)
|
else
|
||||||
# Handle nesting (silence this message, as some users found it noisy?)
|
case "$TERM" in
|
||||||
# printf "$(gettext 'To launch in a nested session, run: byobu')\n"
|
*screen*)
|
||||||
true
|
# Handle nesting (silence this message, as some users found it noisy?)
|
||||||
;;
|
# printf "$(gettext 'To launch in a nested session, run: byobu')\n"
|
||||||
dumb)
|
true
|
||||||
# Dumb terminal, don't launch
|
;;
|
||||||
false
|
dumb)
|
||||||
;;
|
# Dumb terminal, don't launch
|
||||||
*)
|
false
|
||||||
exec $BYOBU_PREFIX/bin/byobu "$@"
|
;;
|
||||||
;;
|
*)
|
||||||
esac
|
exec $BYOBU_PREFIX/bin/byobu "$@"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
false
|
false
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,8 @@ Users of a non-UTF8 locale (such as cs_CZ charset ISO-8859-2), may need to add "
|
||||||
|
|
||||||
Users who customize their PS1 prompt need to put this setting in \fI~/.bashrc\fP, rather than \fI~/.profile\fP, in order for it to work correctly with Byobu.
|
Users who customize their PS1 prompt need to put this setting in \fI~/.bashrc\fP, rather than \fI~/.profile\fP, in order for it to work correctly with Byobu.
|
||||||
|
|
||||||
|
If you run \fBbyobu\fP(1) under \fBsudo\fP(8), you \fBmust\fP use the -H option, such that the user's $HOME directory environment variable is set properly. Otherwise, \fBbyobu\fP(1) will create a bunch of directories in the $SUDO_USER's $HOME, but will be owned by root. To prevent this from happening, \fBbyobu\fP(1) will simply refuse to run if $USER does not own $HOME.
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP
|
.TP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue