Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 549102 - gnome-base/gdm-3.14.2 - /etc/gdm/Xsession sources ~/.bash_profile using default shell
Summary: gnome-base/gdm-3.14.2 - /etc/gdm/Xsession sources ~/.bash_profile using defau...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-10 18:47 UTC by Chris Mayo
Modified: 2021-04-30 16:08 UTC (History)
5 users (show)

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


Attachments
Patch to dotfiles in FILESDIR (bash-skel-posix.patch,736 bytes, patch)
2015-05-10 18:47 UTC, Chris Mayo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mayo 2015-05-10 18:47:08 UTC
Created attachment 402986 [details, diff]
Patch to dotfiles in FILESDIR

With dash as /bin/sh GNOME records the following warning on login:
/etc/gdm/Xsession[879]: /etc/gdm/Xsession: 5: /home/<user>/.bash_profile: [[: not found

Patch to /etc/skel dotfiles in FILESDIR attached using recommendations from the Bash Reference Manual
http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
http://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html
Comment 1 Adam Feldman gentoo-dev 2015-05-12 21:27:33 UTC
I wonder if this is a GDM bug, where it tries to have sh source .bash_profile, regardless of whether sh is bash (or something like that).  To me, at least, that seems the appropriate line of investigation.

Bash files should be able to use bash(isms), so I don't think I agree with the proposed solution/course of action.

CC'ing both the bash and gnome teams, in case they have any input to add at this stage in the game
Comment 2 SpanKY gentoo-dev 2015-05-13 02:47:50 UTC
Comment on attachment 402986 [details, diff]
Patch to dotfiles in FILESDIR

sounds like a gdm bug.  the whole point of naming files .bash_xxx is so that you can do bash-specific things in them.  fixing the dot files won't help when users are putting bash code in there themselves.
Comment 3 Chris Mayo 2015-05-13 18:23:31 UTC
Looks like the the final step is /etc/X11/xinit/xinitrc.d/49-keychain (belonging to gdm) being sourced by /etc/gdm/Xsession.

#!/bin/bash

# source keychain variables

keychain="`which keychain 2>/dev/null`"
if [ -n "$keychain" ] && [ -x "$keychain" ] && [ -f "$HOME/.bash_profile" ]
then
	. "${HOME}/.bash_profile"
fi
Comment 4 Pacho Ramos gentoo-dev 2015-05-14 19:14:03 UTC
(In reply to Chris Mayo from comment #3)
> Looks like the the final step is /etc/X11/xinit/xinitrc.d/49-keychain
> (belonging to gdm) being sourced by /etc/gdm/Xsession.
> 
> #!/bin/bash
> 
> # source keychain variables
> 
> keychain="`which keychain 2>/dev/null`"
> if [ -n "$keychain" ] && [ -x "$keychain" ] && [ -f "$HOME/.bash_profile" ]
> then
> 	. "${HOME}/.bash_profile"
> fi

Then... the solution would be to make this compatible with #!/bin/sh ?
Comment 5 SpanKY gentoo-dev 2015-05-14 22:58:31 UTC
(In reply to Pacho Ramos from comment #4)

you can drop 49-keychain entirely, or make gdm execute the session code using /bin/bash explicitly
Comment 6 Alexander Tsoy 2019-08-20 22:48:19 UTC
Can we just drop 50-ssh-agent and 49-keychain? People who use gdm likely also run desktop environment that can handle ssh and gpg agents. The others can customise their xsession.
Comment 7 Alexander Tsoy 2019-08-20 22:52:55 UTC
(In reply to Alexander Tsoy from comment #6)
> Can we just drop 50-ssh-agent and 49-keychain?
And they shouldn't be installed by gdm in the first place.
Comment 8 Larry the Git Cow gentoo-dev 2021-04-30 16:08:44 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7cbef6cf8bcca85cbb0594e62226c8a6a262b69

commit b7cbef6cf8bcca85cbb0594e62226c8a6a262b69
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2021-04-30 02:27:41 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2021-04-30 16:08:16 +0000

    gnome-base/gdm: Version bump to 40.0
    
    * Drop 49-keychain and 50-ssh-agent files (bugs #549102, #692648)
    * Switch to Meson (resolves bug #585976)
    ** Remove unnecessary fontconfig, libXext, iso-codes, libgudev,
       libXinerama dependencies
    * Remove unused introspection, smartcard, xinerama USE flags
    * Depend on xorg-server[-minimal] (bug #660546)
    * Resolve bug #613222, resolved upstream in v40.0
    * Resolve bug #733708, resolved upstream in v3.38
    
    Bug: https://bugs.gentoo.org/762460
    Closes: https://bugs.gentoo.org/549102
    Closes: https://bugs.gentoo.org/585976
    Closes: https://bugs.gentoo.org/613222
    Closes: https://bugs.gentoo.org/660546
    Closes: https://bugs.gentoo.org/692648
    Closes: https://bugs.gentoo.org/733708
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 gnome-base/gdm/Manifest                            |   1 +
 ...dm-40.0-meson-allow-building-with-elogind.patch | 211 +++++++++++++++++++++
 gnome-base/gdm/gdm-40.0.ebuild                     | 207 ++++++++++++++++++++
 3 files changed, 419 insertions(+)