From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1NiHlD-00045V-AP for garchives@archives.gentoo.org; Fri, 19 Feb 2010 01:34:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D3CAE0948; Fri, 19 Feb 2010 01:33:59 +0000 (UTC) Received: from mail-pv0-f53.google.com (mail-pv0-f181.google.com [74.125.83.181]) by pigeon.gentoo.org (Postfix) with ESMTP id E7464E0948 for ; Fri, 19 Feb 2010 01:33:58 +0000 (UTC) Received: by pvc30 with SMTP id 30so62790pvc.40 for ; Thu, 18 Feb 2010 17:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=RM5TjBkdyJ/Iib9/L8ucAMvLe3YIkPdJrC7VGuJJBHU=; b=ghInq6Ovq9Lghb2CnWolZcG9E4NPP7ZrkkLFtMEcLxsOxG6J7Ar4jpiLpK8my4rj0q w4wSz629jXXoJ2HqULz8bPYYGTmXowDCw1MttPP2PKqajtShVKieSj4K+MFkdwwksEZT cLZW+Mx23hf/mc3Lx3fezaJ1iVWsi2Z7Y+ikY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=ZGRtTkEudm6q8rOtku0losQmtt24XbH6CRSaghCUOWDLTbEdpO2mPRj/5lPEzp6iro pmpHFG3XxV1/WRVPZHKD/VPp9LN/Gu3H+qqJ68SAN7oiD01tbTAKrut5JO3uBXz203r7 nY3XIHCRZp0FkZ/lmsmOIoDPxEvnT0UT9QYUA= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.142.7.24 with SMTP id 24mr6999909wfg.2.1266543238332; Thu, 18 Feb 2010 17:33:58 -0800 (PST) Date: Fri, 19 Feb 2010 10:33:58 +0900 Message-ID: <3ac129341002181733m4af5bea0j53e67fcd09100470@mail.gmail.com> Subject: [gentoo-user] zsh and sudo From: daid kahl To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 6b087aab-4856-4010-b8f2-87dceb6f2e7c X-Archives-Hash: 15a8060e75f7f21d66527c155bca76b3 Hello, I just installed zsh recently and was working on making the switch over from bash for my daily user, provided I can get a few things worked out. The biggest problem that I can't find useful results googling is zsh interaction with sudo. I'm noticing some strange behavior with the PATH and also the interpretation of '=3D'. daid@flux log % sudo which useradd which: no useradd in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.3= :/opt/sun-jdk-1.4.2.17/bin:/opt/sun-jdk-1.4.2.17/jre/bin:/opt/sun-jdk-1.4.2= .17/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin) daid@flux log % sudo echo $PATH /usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.3:= /opt/sun-jdk-1.4.2.17/bin:/opt/sun-jdk-1.4.2.17/jre/bin:/opt/sun-jdk-1.4.2.= 17/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin:/home/daid/scri= pts:/sbin:/home/daid/.gentoo/java-config-2/current-user-vm/bin:/usr/sbin:/u= sr/local/warlock2:/usr/local/sbin:/home/daid/physics/transport_for_crib/tra= nsport1.6/bin daid@flux log % which useradd /usr/sbin/useradd So sudo has the PATH set correctly, but it doesn't actually use the correct path. Fishy! It gets more confusing. Any new zsh opened within a first instance of zsh things work as expected: daid@flux log % zsh daid@flux log % sudo which useradd /usr/sbin/useradd This happens in X and at console login. One can assume that either ghosts are haunting my machine, there was a solar flare flipping bits on my hdd, or I've done something silly. If I make root set my user's path, then sudo is fine. So basically the problem is that it's defaulting to checking root's path and not the user path, which is not the documented behavior on Gentoo (nor consistent with sudo in other shells. As for interpretation of '=3D' I really don't understand what's happening. It seems indiscriminate of the case in terms of mucking about, but the exact result it not always the same. Consider the monstrous output in the following simple case of making a new environment variable: daid@flux log % sudo TEST=3D"testing" LESSOPEN=3D|lesspipe.sh %s XDG_DATA_DIRS=3D/usr/local/share:/usr/kde/3.5/share:/usr/share:/usr/share GLADE_CATALOG_PATH=3D: GTK_PATH=3D:/usr/lib/gtk-2.0 PATH=3D/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin= /4.4.3:/opt/sun-jdk-1.4.2.17/bin:/opt/sun-jdk-1.4.2.17/jre/bin:/opt/sun-jdk= -1.4.2.17/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin GDK_USE_XFT=3D1 SSH_AUTH_SOCK=3D/tmp/ssh-mCuWxp2532/agent.2532 USER=3Droot QTDIR=3D/usr/qt/3 PRELINK_PATH_MASK=3D/usr/lib/klibc SHELL=3D/bin/zsh DBUS_SESSION_BUS_ADDRESS=3Dunix:abstract=3D/tmp/dbus-HBS914aGoB,guid=3D109c= 64af5b65dda3804f8d4d4b7de295 LESS=3D-R -M --shift 5 JAVACC_HOME=3D/usr/share/javacc/ GCC_SPECS=3D CONFIG_PROTECT_MASK=3D/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/texmf/web2c /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/revdep-rebuild /etc/splash LIBGLADE_MODULE_PATH=3D:/usr/lib/libglade/2.0 OPENGL_PROFILE=3Dxorg-x11 GENERATION=3D2 MAIL=3D/var/mail/daid JAVAC=3D/home/daid/.gentoo/java-config-2/current-user-vm/bin/javac ANT_HOME=3D/usr/share/ant XAUTHORITY=3D/home/daid/.Xauthority PAGER=3D/usr/bin/less SHLVL=3D2 _=3D/usr/bin/sudo QMAKESPEC=3Dlinux-g++ WINDOWID=3D25165872 GLADE_MODULE_PATH=3D: TERM=3Dxterm PWD=3D/home/daid/log COLORTERM=3DTerminal CONFIG_PROTECT=3D/usr/share/X11/xkb /var/lib/hsqldb /usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown /usr/share/config CVS_RSH=3Dssh GLADE_PIXMAP_PATH=3D: JDK_HOME=3D/home/daid/.gentoo/java-config-2/current-user-vm VMHANDLE=3Dsun-jdk-1.4 INFOPATH=3D/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.20/= info:/usr/share/gcc-data/i686-pc-linux-gnu/4.4.3/info SESSION_MANAGER=3Dlocal/flux:@/tmp/.ICE-unix/2541,unix/flux:/tmp/.ICE-unix/= 2541 DISPLAY=3D:0.0 LOGNAME=3Droot JAVA_HOME=3D/home/daid/.gentoo/java-config-2/current-user-vm SSH_AGENT_PID=3D2533 MANPATH=3D/home/daid/.gentoo/java-config-2/current-user-vm/man:/usr/local/s= hare/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.20/man= :/usr/share/gcc-data/i686-pc-linux-gnu/4.4.3/man:/opt/sun-jdk-1.4.2.17/man:= /etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man XDG_CONFIG_DIRS=3D/etc/xdg SGML_CATALOG_FILES=3D/etc/sgml/sgml-ent.cat:/etc/sgml/openjade-1.3.2.cat:/e= tc/sgml/sgml-docbook.cat:/etc/sgml/sgml-docbook-3.1.cat:/etc/sgml/dsssl-doc= book-stylesheets.cat:/etc/sgml/sgml-lite.cat:/etc/sgml/xml-docbook-4.4.cat:= /etc/sgml/xml-docbook-4.1.2.cat HOME=3D/home/daid EDITOR=3D/usr/bin/vi OLDPWD=3D/home/daid/log MOCADI_DIR=3D/home/daid/physics/rib_model/mocadi MOCADI_DATA=3D/home/daid/physics/rib_model/mocadi/data MOCADI_SPLINES_GZ=3D/home/daid/physics/rib_model/mocadi/splines_gz ROOTSYS=3D/usr ROOT_LIBRARIES=3D/usr/lib/root MYSQL=3D/usr/include/mysql:/usr/lib/mysql MYSQL_TCP_PORT=3D3306 JAVADIR=3D/usr/lib/jvm/sun-jdk-1.6 USERNAME=3Droot SUDO_COMMAND=3D/bin/env PATH=3D/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin= /4.4.3:/opt/sun-jdk-1.4.2.17/bin:/opt/sun-jdk-1.4.2.17/jre/bin:/opt/sun-jdk= -1.4.2.17/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin TEST=3Dtesting SUDO_USER=3Ddaid SUDO_UID=3D1000 SUDO_GID=3D1009 TEST=3Dtesting Or if I want to emerge a specific package, instead I get: daid@flux log % sudo emerge =3Dsudo-1.7.2_p2-r2 zsh: sudo-1.7.2_p2-r2 not found Unlike the PATH problems, the equal problems do not go away with a new instance of zsh overtop of the first one. I'm experiencing some other problems with zsh as well, but being able to use sudo is reasonably more pressing, and basic googling on the other errors (problems sourcing /etc/profile and getting a bash prompt, trying to set zsh as my slim login shell fails to login). As always, I'm suspicious that I've done something stupid, but I don't see anything obvious. I can use tcsh and bash both just fine. This occurred for both x86 builds on an x86 arch and ~x86 builds on an ~x86 arch with the most recent versions of sudo and zsh for those respective arch settings (recent ~x86 upgrade). revdep-rebuild still has a couple things to take care of that need babysitting and/or bug reports, but I would be extremely surprised if those packages are at all related here (things for tex and also libjpeg). I'll happily take any advice, even if it's "go back to bash" (although some tips on auto-completion and command correction would be welcome, since I didn't get any reasonable results for these features with bash). If it's useful I'll post my working .zshrc and such, but honestly I can't see much reason to do so now since I don't see it as relevant to the problems I see. Toodles, daid