From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107 invoked by alias); 2 Apr 2014 09:24:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32518 Received: (qmail 11136 invoked from network); 2 Apr 2014 09:23:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-b7fc96d000004885-6e-533bd7250cae Date: Wed, 02 Apr 2014 10:23:48 +0100 From: Peter Stephenson To: Erik Johnson Cc: zsh-workers@zsh.org Subject: Re: LOGNAME not properly set on FreeBSD Message-id: <20140402102348.4ceeddad@pwslap01u.europe.root.pri> In-reply-to: <20140401212239.GE20508@gmail.com> References: <20140401212239.GE20508@gmail.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t/xy7qq162DDe6ckLH4euY3k8XB5odM DkweO2fdZfdYdfADUwBTFJdNSmpOZllqkb5dAlfGjjnrWQpeslf86+tmamBczNbFyMkhIWAi cfB+GyOELSZx4d56oDgXh5DAUkaJj5t3sEM4/UwS+/+vYOli5OBgEVCVOHxPFqSBTcBQYuqm 2WDNIkDh20vmM4OUMAuIS8yeEggSFhYwkDi3+B0LiM0rYC/x9NR9sL2cAvoSL1/3grUKCehJ 3Pp3jAnE5geKX/37iQniHnuJmVfOMEL0Ckr8mHwPbA6zgJbE5m1NrBC2tsSTdxdYJzAKzkJS NgtJ2SwkZQsYmVcxiqaWJhcUJ6XnGukVJ+YWl+al6yXn525ihATr1x2MS49ZHWIU4GBU4uGV vGQVLMSaWFZcmXuIUYKDWUmE98NF62Ah3pTEyqrUovz4otKc1OJDjEwcnFINjG6C1QzWH5cz ZXWd0ugVEbe8M+FFcsZqL68XM00Cqu5y1zzUK3ScnSrwLfDPhqK2PXyW1v4VypILblf/ShQN PfpQIjDc56B+9dYeY5Flz5z/Tda8qXB1tb3zx22aLhfkpv3IX/rq8SPp3N9m0w1ck/nezV3B o501vYWvLvwew2Gfra+P3nmhrcRSnJFoqMVcVJwIAHJmACw0AgAA On Tue, 01 Apr 2014 16:22:39 -0500 Erik Johnson wrote: > When using "su - username" to change users, zsh is not properly setting > the LOGNAME environment variable on FreeBSD. Example below. >=20 > erik@virtubsd:~% zsh --version > zsh 5.0.2 (amd64-portbld-freebsd9.1) > erik@virtubsd:~% su - root > Password: > virtubsd# echo $LOGNAME > erik =46rom the code, it looks like this would only happen if getlogin() is returning the wrong thing, i.e. "erik", or it's not returning anything and the shell is having to guess and doing so wrongly. Although that doesn't seem very likely it's hard to see another way this can happen within the shell. Presumably python -c 'import os; print os.getlogin()' prints "root"? It might also be useful to start the shell with the "-x" option to check all the initialisation scripts. I'm not sure you can do that with su without some fiddling but you could put "set -x" temporarily at the top of /etc/zshenv. pws