From 150dc583b7d2801377ca8716bc20b2a669d6cdca Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 3 Nov 2010 00:48:39 -0500 Subject: [PATCH] usr/bin/byobu, usr/bin/byobu-janitor, usr/share/byobu/profiles/common: change location of $SSH_AUTH_SOCK symlink from /var/run to $HOME, as we can't be sure that the user's var/run dir will exist before screen starts, LP: #664059 --- debian/changelog | 4 ++++ usr/bin/byobu | 8 ++++---- usr/bin/byobu-janitor | 17 ++++++++--------- usr/share/byobu/profiles/common | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index e6a0921f..b5b9eaa7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,10 @@ byobu (3.7) unreleased; urgency=low * README: add a note about gsed * usr/share/man/man1/byobu.1: add a synopsis section that mentions options simply passed through to screen, LP: #669566 + * usr/bin/byobu, usr/bin/byobu-janitor, + usr/share/byobu/profiles/common: change location of $SSH_AUTH_SOCK symlink + from /var/run to $HOME, as we can't be sure that the user's var/run + dir will exist before screen starts, LP: #664059 -- Dustin Kirkland Thu, 21 Oct 2010 12:09:14 -0500 diff --git a/usr/bin/byobu b/usr/bin/byobu index 6a70920b..28133607 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -68,10 +68,10 @@ grep -qs "^[^#]" "$BYOBU_WINDOWS" && DEFAULT_WINDOW= || DEFAULT_WINDOW="shell" # Check if our terminfo supports 256 colors $(which tput >/dev/null) && [ $(tput colors 2>/dev/null || echo 0) -eq 256 ] && SCREEN_TERM="-T screen-256color" -# Create or update ssh-agent socket -if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then - rm -f "$RUN/$PKG.ssh-agent" - ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" +# Drop a symlink to the ssh socket in $HOME, since we can ensure that exists +if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then + rm -f "$HOME/.$PKG/.ssh-agent" + ln -sf "$SSH_AUTH_SOCK" "$HOME/.$PKG/.ssh-agent" fi PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/byoburc" diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 0d52ca20..b4175cbd 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -25,9 +25,6 @@ PKG="byobu" RUN="$SOCKETDIR/S-$USER" FLAG="$RUN/$PKG.reload-required" -# Use gsed on non-Linux OS's -which gsed 2>/dev/null && SED="gsed" || SED="sed" - # Exit immediately, if we're not forced, and there is no reload flag if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then exit 0 @@ -36,12 +33,8 @@ fi # Set the rest of the variables DEFAULT_PROFILE="light" PROFILE="$HOME/.$PKG/profile" - -# Establish ssh-agent socket, helps when reconnecting to a detached session -if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then - rm -f "$RUN/$PKG.ssh-agent" - ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" -fi +# Use gsed on non-Linux OS's +which gsed 2>/dev/null && SED="gsed" || SED="sed" # Create byobu-exchange buffer file, with secure permissions, if it doesn't exist if [ -w "$RUN" ] && [ ! -e "$RUN/$PKG-exchange" ]; then @@ -160,5 +153,11 @@ if grep -qs "motd+shell" "$HOME/.$PKG/windows"; then $SED -i -e "s/motd+shell/shell/g" "$HOME/.$PKG/windows" || true fi +# Affects: Upgrades from <= byobu-3.6, change location of $SSH_AUTH_SOCK +if [ -h "$RUN/$PKG.ssh-agent" ]; then + rm -f "$HOME/.$PKG/.ssh-agent" + mv -f "$RUN/$PKG.ssh-agent" "$HOME/.$PKG/.ssh-agent" +fi + # Clean up flag rm -f "$FLAG" diff --git a/usr/share/byobu/profiles/common b/usr/share/byobu/profiles/common index a9455d95..8c146490 100644 --- a/usr/share/byobu/profiles/common +++ b/usr/share/byobu/profiles/common @@ -98,7 +98,7 @@ defmonitor on activity "" # Maintain SSH_AUTH_SOCK link -setenv SSH_AUTH_SOCK /var/run/screen/S-$USER/byobu.ssh-agent +setenv SSH_AUTH_SOCK $HOME/.byobu/.ssh-agent source $HOME/.byobu/keybindings