Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69925 - upgrade to shadow-4.0.5 prevents 'xauth -merge' while 'su -'ing
Summary: upgrade to shadow-4.0.5 prevents 'xauth -merge' while 'su -'ing
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-03 02:06 UTC by Michael Schilling
Modified: 2005-05-06 23:41 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schilling 2004-11-03 02:06:47 UTC
Users that upgraded to shadow-4.0.5 can't use X applications when 'su -'ing to root.
I used this code in my root .profile to allow the use of X-applications:

if [ -r /var/run/console.lock ]
then
su `cat /var/run/console.lock` -c "/usr/X11R6/bin/xauth extract - $DISPLAY"|xaut
h merge -
fi

With shadow-4.0.5 the error always is:

/usr/X11R6/bin/xauth: (argv):1:  bad "extract" command line
xauth: (argv):1:  unable to read any entries from file "(stdin)"

A downgrade to shadow-4.0.4.1-r4 solved the problem so far.

Reproducible: Always
Steps to Reproduce:
Comment 1 Michael Schilling 2004-11-03 02:09:27 UTC
There is also a thread in the gentoo forums http://forums.gentoo.org/viewtopic.php?p=1720367#1720367

(sorry that I forgot it in the first place)
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2004-11-03 03:42:38 UTC
And there is also Bug 69895 and Bug 69781 and I don
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2004-11-03 03:42:38 UTC
And there is also Bug 69895 and Bug 69781 and I don´t really see why this version is marked stable. :-(
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2004-11-03 04:39:03 UTC
And Bug 69932 (and another two already fixed). 

Would someone be so kind and mark the bug infested version as unstable as soon as possible? Also I would recommend to raise the priority way above normal. It does not fix any vulnerability anyway b/c people are not able to install it. :-(
Comment 5 SpanKY gentoo-dev 2004-11-03 15:23:22 UTC
looks like it's due to the XAUTHORITY env var not being passed on to the new session

iirc this has come up before, lemme track it down and release 4.0.5-r2
Comment 6 SpanKY gentoo-dev 2004-11-03 15:47:34 UTC
actually, i lied ... this is NOTABUG

i looked back through some correspondence between upstream shadow maintainer and us Gentoo devs and this is the correct behavior

from the ChangeLog:
    * NEWS, src/su.c:
    add pam_open_session() support. If builded without PAM support
    propagate $DISPLAY and $XAUTHORITY enviroment variables.

notice that if PAM is enabled, DISPLAY/XAUTHORITY are not propogated ... you're supposed to setup the propogation of these vars yourself (gasp!) via pam_xauth

so, what i will do in the meantime (because 4.0.5 was forced into stable due to SECURITY ISSUES), i'll restore the backwards-compat behavior in 4.0.5-r2

come next unstable release though, this hack will be removed and we will start forcing users to do The Right Thing (tm)
Comment 7 Marko Daniel 2004-11-04 14:57:29 UTC
It seems that "The Right Thing" is broken in gentoo, though.

Have line "session    required     /lib/security/pam_xauth.so" in /etc/pam.d/su but it makes no difference.
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2004-11-07 09:51:47 UTC
No, its not pam_xauth that is needed (the hack is needed for pam_xauth to work
properly), but pam_env according to the current shadow maintainer.  I have tried
this local, but does not work for me.  I have contacted him again, so will have
to wait.

Mike, please leave the hack until I get back to you.
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2004-11-08 10:35:25 UTC
Ok, with these it should be fixed again:

--------
# epm -q pam shadow
pam-0.77-r3
shadow-4.0.5-r3
--------

Just make sure you have merged the changes in /etc/pam.d/su and
/etc/security/pam_env.conf ...
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2004-11-08 10:44:53 UTC
.
Comment 11 Tim Burrell 2004-11-11 06:39:15 UTC
upgrading to the latest r3 variants of pam and shadow does NOT fix this problem for remote X11 forwarding.
Comment 12 Matteo Settenvini 2004-11-17 14:55:15 UTC
Still experiencing this. Just trying:

su -
xlogo

sits there forever. This for every user (but the current one, of course).
Comment 13 Yi S. Ding 2004-11-17 21:18:19 UTC
Yep.  Not only did the fix not do what it was supposed to, it also added a bunch of errors:

The changes were incorrect because 1) XAUTHORITY is not recognized as a PAM variable by PAM_ENV (look at the pam_env.c code if you don't believe me), and 2)

REMOTEHOST	DEFAULT= OVERRIDE=@{PAM_RHOST}

should be

REMOTEHOST	DEFAULT=localhost OVERRIDE=@{PAM_RHOST}

Otherwise, the line

DISPLAY		DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}

will produce an error saying REMOTEHOST is an invalid variable.

This bug should be reopened.
Comment 14 Wouter Deconinck 2004-11-22 13:10:24 UTC
Same problem here.  See also http://forums.gentoo.org/viewtopic.php?t=255675.
Comment 15 Christopher DeMarco 2004-11-25 20:49:42 UTC
Ding is right - this bug needs to be reopened... Also confirmed that Ding's fix works.
Comment 16 J. Alexander Treuman 2004-11-26 16:58:46 UTC
This should be fixed in 4.0.5-r3 by shadow-4.0.5-fix-adding-of-pam_env-set-env-vars.patch, which is applied upstream in 4.0.6. I'm running that now and XAUTHORITY does get set properly by pam_xauth. Not sure if the script in the initial submission works, but with pam_xauth you shouldn't need it anyway.
Unfortunately, the "fixes" applied in pam_env.conf are still breaking things and never actually helped. For that, see bug 70585.
Comment 17 J. Alexander Treuman 2004-11-26 17:47:54 UTC
Sorry, I didn't test before commenting, and it turns out I'm wrong. Using su works now, but su - is still broken. Looking at the source I can't figure out why. su makes a point of saving XAUTHORITY and DISPLAY when using -, but for some reason only XAUTHORITY (which pam_xauth sets) makes it through, while DISPLAY (which is just inherited from the original environment) magically disappears. If not using pam_xauth, neither make it. This could also be fixed in pam_xauth by setting both itself.
Comment 18 Matteo Settenvini 2004-11-30 02:33:44 UTC
>  Using su works now, but su - is still broken.

No, "su" doesn't work for me. "su -" still doesn't too.
Is it a shadow or PAM issue, at last?
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2004-12-06 05:59:45 UTC
Could someone plz. reopen this annoying bug? It is NOT fixed!