Bug 367611 - login(1) should start a D-Bus session bus and ssh-agent
login(1) should start a D-Bus session bus and ssh-agent
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: util-linux-ng (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-05 17:09 EST by Nalin Dahyabhai
Modified: 2010-09-08 06:07 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-09 00:05:41 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to make login start up ssh-agent and a session bus (7.81 KB, patch)
2007-11-05 17:09 EST, Nalin Dahyabhai
no flags Details | Diff

  None (edit)
Description Nalin Dahyabhai 2007-11-05 17:09:45 EST
Description of problem:
The ssh-agent and a D-Bus session bus aren't intrinsically tied to X sessions,
but we currently wait and let xinit() do the work of starting them, so they're
only available by default while the user is running 'startx'.

Version-Release number of selected component (if applicable):
util-linux-ng-2.13-3.fc8

How reproducible:
Always

Steps to Reproduce:
1. Log in at the console.
2. Run "ssh-add -l".
3. Run "dbus-send --session --print-reply=s --dest=org.freedesktop.DBus /
org.freedesktop.DBus.Introspectable.Introspect"
  
Actual results:
"Could not open a connection to your authentication agent."
"Failed to open connection to session message bus: dbus-launch failed to
autolaunch D-Bus session: Autolaunch error: X11 initialization failed."

Expected results:
"The agent has no identities."
A large pile of introspection data.
Comment 1 Nalin Dahyabhai 2007-11-05 17:09:45 EST
Created attachment 248641 [details]
patch to make login start up ssh-agent and a session bus
Comment 2 Nalin Dahyabhai 2007-11-09 14:34:35 EST
Comment on attachment 248641 [details]
patch to make login start up ssh-agent and a session bus

Hmm, actually the third arguments to AC_ARG_ENABLE are wrong.
Comment 3 Karel Zak 2007-11-13 07:58:01 EST
Sorry, but this is ugly hack. I really don't want to hardcode any command line
to the login(8).

Cannot we try to found any better solution? PAM (pam_exec), /etc/profile, HAL or
whatever?

Hmm, the pam_exec is probably useless if you need to set SSH_AUTH_SOCK and
SH_AGENT_PID.
Comment 4 Karel Zak 2007-11-13 08:15:19 EST
What about to:

 - init  by /etc/profile.d/dbus-session and /etc/profile.d/ssh-agent 
   and write PIDs to $HOME/.dbus.<tty> and $HOME/.ssh-agent.<tty> 

 - deinit  by pam_exec /usr/bin/dbus-session-cleanup and
   /usr/bin/ssh-agent-cleanup

I think it's much better.
Comment 5 Miloslav Trmač 2007-11-13 08:40:59 EST
Why is ssh-agent / DBus necessary for non-X sessions?

If it is necessary for console sessions, won't it be necessary for ssh sessions
as well?

In that case, we could use /bin/fedora-session-bash as a default login shell
(and fedora-session-tcsh for tcsh, etc.).  This binary would, when launched as a
login shell, launch all the necessary daemons, run the specified "real" login
shell, an kill the daemons after the shell exits.

IOW, replace
     exec -l $SHELL -c "$SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients"
by a simple
     exec -l $SHELL
and let $SHELL take care of all the necessary daemons.

If fedora-session-bash were run as a non-login shell, it would simply exec bash.

This is cleaner than patching each getty/?dm/whatever separately; as an added
benefit, it would unify the X and non-X launch path.
Comment 6 Nalin Dahyabhai 2007-11-13 10:11:21 EST
(In reply to comment #3)
> Sorry, but this is ugly hack. I really don't want to hardcode any command line
> to the login(8).

Yeah, probably.  There's the big problem that it's sending a signal to a process
from the login process while it's running as root, so problems will arise if the
user causes either of them to exit before the user's session ends.  Please don't
use the patch.

> Cannot we try to found any better solution? PAM (pam_exec), /etc/profile, HAL or
> whatever?

Sure.  I'm not wedded to the implementation.  The scripted methods can get
pretty ugly, but you're right, they're safer.  I'm not sure what HAL would do here.

(In reply to comment #5)
> Why is ssh-agent / DBus necessary for non-X sessions?

The use of the agent has no relationship with X -- it can be started from a
shell prompt and used just as easily.  The X session script was just a simple
means to make it available for the user's session.  I'm not aware of anything
using a D-Bus session bus that doesn't run inside of an X session, but there's
no technical issue that prevents it, either.

> If it is necessary for console sessions, won't it be necessary for ssh sessions
> as well?

OpenSSH already forwards agent connections (that's disabled by default for
security reasons), but it currently doesn't forward D-Bus session bus
connections.  That'd probably be useful, though.

> In that case, we could use /bin/fedora-session-bash as a default login shell
> (and fedora-session-tcsh for tcsh, etc.).  This binary would, when launched as a
> login shell, launch all the necessary daemons, run the specified "real" login
> shell, an kill the daemons after the shell exits.
> 
> IOW, replace
>      exec -l $SHELL -c "$SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients"
> by a simple
>      exec -l $SHELL
> and let $SHELL take care of all the necessary daemons.
> 
> If fedora-session-bash were run as a non-login shell, it would simply exec bash.
> 
> This is cleaner than patching each getty/?dm/whatever separately; as an added
> benefit, it would unify the X and non-X launch path.

I don't think that'll scale well across networks, which won't have the wrapper
on every workstation, or in /etc/shells.

I'm also trying to avoid running the shell directly under ssh-agent -- because
it's setgid, libc discards $LD_LIBRARY_PATH (see ld.so(8)), and that surprises
people who depend on that.
Comment 7 Bug Zapper 2008-04-04 10:26:04 EDT
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
rawhide.
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 8 Bug Zapper 2008-11-26 03:12:33 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Bug Zapper 2009-01-09 00:05:41 EST
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 10 Mildred 2010-09-08 06:07:03 EDT
See bug #631740

Note You need to log in before you can comment on or make changes to this bug.