When logged in as a normal user (w/ wheel and sudo access), when I use su - to work as root I can run programs that connect to the X server, but when I use "sudo su -" I cannot. PAM issue? $ sudo su - # env | grep DISP || echo "not set" not set # gvim /etc/make.conf E233: cannot open display Hit ENTER or type command to continue # export DISPLAY=:0 # gvim /etc/make.conf Xlib: connection to ":0.0" refused by server Xlib: No protocol specified E233: cannot open displayXlib: connection to ":0.0" refused by server Xlib: No protocol specified Hit ENTER or type command to continue [syslog entries, generated by initial sudo su -] Jan 8 11:35:26 dst sudo: grant : TTY=pts/4 ; PWD=/home/grant ; USER=root ; COMMAND=/bin/su - Jan 8 11:35:26 dst sudo: PAM pam_putenv: delete non-existent entry; REMOTEHOST Jan 8 11:35:26 dst PAM-env[20816]: Unknown PAM_ITEM: <DISPLAY> Jan 8 11:35:26 dst sudo[20816]: PAM pam_putenv: delete non-existent entry; DISPLAY Jan 8 11:35:26 dst PAM-env[20816]: Unknown PAM_ITEM: <XAUTHORITY> Jan 8 11:35:26 dst sudo[20816]: PAM pam_putenv: delete non-existent entry; XAUTHORITY Jan 8 11:35:26 dst su(pam_unix)[20816]: session opened for user root by (uid=0) Jan 8 11:35:26 dst su[20816]: PAM pam_putenv: delete non-existent entry; REMOTEHOST Jan 8 11:35:26 dst PAM-env[20816]: Unknown PAM_ITEM: <DISPLAY> Jan 8 11:35:26 dst su[20816]: PAM pam_putenv: delete non-existent entry; DISPLAY Jan 8 11:35:26 dst PAM-env[20816]: Unknown PAM_ITEM: <XAUTHORITY> Jan 8 11:35:26 dst su[20816]: PAM pam_putenv: delete non-existent entry; XAUTHORITY $ su - # env | grep DISP DISPLAY=:0.0 # gvim /etc/make.conf (works fine) [syslog] Jan 8 11:33:09 dst su[20755]: PAM pam_putenv: delete non-existent entry; REMOTEHOST Jan 8 11:33:09 dst PAM-env[20755]: Unknown PAM_ITEM: <DISPLAY> Jan 8 11:33:09 dst su[20755]: PAM pam_putenv: delete non-existent entry; DISPLAY Jan 8 11:33:09 dst PAM-env[20755]: Unknown PAM_ITEM: <XAUTHORITY> Jan 8 11:33:09 dst su[20755]: PAM pam_putenv: delete non-existent entry; XAUTHORITY Jan 8 11:33:09 dst su(pam_unix)[20755]: session opened for user root by (uid=1000) Jan 8 11:33:09 dst su[20755]: PAM pam_putenv: delete non-existent entry; REMOTEHOST Jan 8 11:33:09 dst PAM-env[20755]: Unknown PAM_ITEM: <DISPLAY> Jan 8 11:33:09 dst su[20755]: PAM pam_putenv: delete non-existent entry; DISPLAY Jan 8 11:33:09 dst PAM-env[20755]: Unknown PAM_ITEM: <XAUTHORITY> Jan 8 11:33:09 dst su[20755]: PAM pam_putenv: delete non-existent entry; XAUTHORITY # emerge pam -vp These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] sys-libs/pam-0.77-r4 +berkdb -debug -pwdb (-selinux) 0 kB # emerge info Portage 2.0.51-r8 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.9-gentoo-r9 i686) ================================================================= System uname: 2.6.9-gentoo-r9 i686 AMD Athlon(TM) XP 2400+ Gentoo Base System version 1.6.8 Python: dev-lang/python-2.3.4 [2.3.4 (#1, Dec 8 2004, 11:07:37)] distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] dev-lang/python: 2.3.4 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.3 sys-devel/binutils: 2.15.92.0.2-r2 sys-devel/libtool: 1.5.10-r2 virtual/os-headers: 2.6.8.1-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-pipe -O2 -mtune=i686" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-pipe -O2 -mtune=i686" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig buildpkg ccache cvs distlocks sandbox sfperms" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" LDFLAGS="" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow X aalib acl alsa apm arts avi berkdb bitmap-fonts cdr crypt cscope cups dvd encode esd fam flac foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imagemagick imlib ipv6 java jpeg kde libwww mad mailwrapper mikmod milter mmx motif mozilla mpeg ncurses nls nptl oggvorbis opengl oss pam pda pdflib perl png python qt quicktime readline ruby sasl scanner sdl slang spell sse ssl svga tcltk tcpd tetex tiff truetype xml xml2 xmms xv zlib" Reproducible: Always Steps to Reproduce: 1. 2. 3.
Oops, probably not actually a "baselayout" bug. Reassigning to pam-bugs.
Solar tells me that sudo now does an env_reset for security reasons. This env reset can be disabled for people in %wheel by uncommenting the # Defaults:%wheel !env_reset line in /etc/sudoers. Also, use sudo su, not sudo su -.