byobu breaks $SSH_AUTH_SOCK

Bug #664059 reported by Matthias Winzeler
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Medium
Unassigned
byobu (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I'm using byobu as shipping with ubuntu maverick meerkat:

$ byobu -v
byobu version 3.5
Screen version 4.00.03jw4 (FAU) 2-May-06

I recently noticed that byobu breaks $SSH_AUTH_SOCK so that connecting the ssh-agent fails:

# Without byobu:
$ echo $SSH_AUTH_SOCK; ls -l $SSH_AUTH_SOCK
/tmp/keyring-qDio3Y/ssh
srwxr-xr-x 1 matthias matthias 0 2010-10-20 18:08 /tmp/keyring-qDio3Y/ssh

# After launching byobu:
byobu
echo $SSH_AUTH_SOCK; ls -l $SSH_AUTH_SOCK
/var/run/screen/S-matthias/byobu.ssh-agent
ls: Zugriff auf /var/run/screen/S-matthias/byobu.ssh-agent nicht möglich: No such file or directory

# as a result every connection to the ssh-agent fails

The following lines in /usr/bin/byobu seem weird to me:
 72 # Create or update ssh-agent socket
 73 if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; th en
 74 rm -f "$RUN/$PKG.ssh-agent"
 75 ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent"
 76 fi

The write flag of the directory $RUN is checked - but $RUN is not defined in /usr/bin/byobu and the symbolic link is not properly set up. Byobu-janitor contains these lines, too (lines 38-41) but sets $RUN correctly at the top of the script. Should these lines possibly be removed from /usr/bin/byobu? Otherwise, $RUN must be correctly set in /usr/bin/byobu. If I add the following two lines in byobu, it works:

[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen"
RUN="$SOCKETDIR/S-$USER"

Related branches

description: updated
Revision history for this message
Matthias Winzeler (matthias-winzeler) wrote :

I have to correct my statement: It does not work by simply defining $RUN in /usr/bin/byobu because on the first start, $RUN (i.e. /var/run/screen) does not exist yet and the condition -w "$RUN" will fail (the same applies to the condition in byobu-janitor). Thus the symlink will be broken. On the second start, screen (?) has created /var/run/screen, byobu-janitor will set up the symlink and everything will be fine.

It would be great if two things could be checked:
1. The additional check for the symlink in /usr/bin/byobu seems to be redundant to me - byobu-janitor would take care of that.
Remove these lines?

2. $SSH_AUTH_SOCK is broken on first startup of byobu, because it checks the existence of /var/run/screen that does not exist. Maybe the whole process with the symlinking should be reconsidered?

Thank you!

Changed in byobu:
importance: Undecided → Medium
status: New → Triaged
Changed in byobu:
status: Triaged → Incomplete
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi there, thanks for the report.

The two checks (in /usr/bin/byobu and in /usr/bin/byobu-janitor) are both necessary, handling two entry different vectors.

I'm researching this one right now.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Aha, so this is a problem on the first launch.

Changed in byobu:
status: Incomplete → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.2 KiB)

This bug was fixed in the package byobu - 3.7-0ubuntu1

---------------
byobu (3.7-0ubuntu1) natty; urgency=low

  [ Dustin Kirkland ]
  * usr/lib/byobu/ec2_cost, usr/share/byobu/ec2/rates.eu_ie,
    usr/share/byobu/ec2/rates.us_ca, usr/share/byobu/ec2/rates.us_va:
    - add ec2_cost support for t1.micro instances, LP: #669190
  * etc/byobu/statusrc, usr/bin/byobu-config, usr/lib/byobu/Makefile.am,
    usr/lib/byobu/notify_osd, usr/share/byobu/profiles/common,
    usr/share/man/man1/byobu.1:
    - add notify_osd support to byobu, LP: #669189
    - separate the perl into a script of its own
    - add per-pid notifier monitors, terminate when screen terminates
    - allow for disabling the notify_osd status; must handle in the perl
      script
    - use BYOBU_PREFIX for local installs
  * usr/bin/byobu-config, usr/bin/byobu-janitor, usr/bin/byobu-launcher-
    uninstall, usr/share/byobu/keybindings/f-keys:
    - use gsed, where available; should help with BSD issues running byobu,
      LP: #651993
  * 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
  * etc/update-motd.d, etc/update-motd.d/55-window-manager,
    etc/update-motd.d/Makefile.am, Makefile.am, usr/bin/byobu-disable,
    usr/bin/byobu-enable:
    - add a helpful update-motd message and a convenient command to enable-and-
      launch byobu
  * usr/bin/byobu-select-session: enable byobu-select-session to list
    custom session names, LP: #630673
  * debian/templates, etc/byobu/statusrc, usr/bin/byobu, usr/bin/byobu-
    janitor, usr/bin/byobu-launcher, usr/bin/byobu-launcher-install,
    usr/bin/byobu-launcher-uninstall, usr/bin/byobu-select-profile,
    usr/bin/byobu-status, usr/lib/byobu/custom, usr/lib/byobu/disk_io,
    usr/lib/byobu/ec2_cost, usr/lib/byobu/hostname,
    usr/lib/byobu/ip_address, usr/lib/byobu/logo,
    usr/lib/byobu/mem_available, usr/lib/byobu/menu,
    usr/lib/byobu/network, usr/lib/byobu/.notify_osd,
    usr/lib/byobu/reboot_required, usr/lib/byobu/services,
    usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys,
    usr/share/byobu/keybindings/screen-escape-keys,
    usr/share/byobu/profiles/byoburc, usr/share/byobu/profiles/common,
    usr/share/man/man1/byobu.1:
    - xdg user dirs overhaul, LP: #553105
  * etc/byobu/statusrc, usr/bin/byobu-config, usr/lib/byobu/mail,
    usr/lib/byobu/Makefile.am, usr/lib/byobu/raid,
    usr/share/byobu/profiles/common, usr/share/man/man1/byobu.1:
    - add a raid notification, LP: #669191
  * usr/bin/byobu-status, usr/lib/byobu/notify_osd:
    - fix all detail printing
  * usr/bin/byobu:
    - fix listing of sessions, LP: #672023
  * usr/lib/byobu/services:
    - drop max instance count from NC service reporting; was inaccurate

  [ Marcus Asshauer ]
  * usr/bin/byobu-config: add directory option when creating new window,
    LP: #623033
 -- Dustin Kirkla...

Read more...

Changed in byobu (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.