From: Peter Stephenson <p.stephenson@samsung.com>
To: Erik Johnson <palehose@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: LOGNAME not properly set on FreeBSD
Date: Wed, 02 Apr 2014 10:23:48 +0100 [thread overview]
Message-ID: <20140402102348.4ceeddad@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20140401212239.GE20508@gmail.com>
On Tue, 01 Apr 2014 16:22:39 -0500
Erik Johnson <palehose@gmail.com> wrote:
> When using "su - username" to change users, zsh is not properly setting
> the LOGNAME environment variable on FreeBSD. Example below.
>
> erik@virtubsd:~% zsh --version
> zsh 5.0.2 (amd64-portbld-freebsd9.1)
> erik@virtubsd:~% su - root
> Password:
> virtubsd# echo $LOGNAME
> erik
From 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
next prev parent reply other threads:[~2014-04-02 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 21:22 Erik Johnson
2014-04-01 21:30 ` Erik Johnson
2014-04-02 0:27 ` Phil Pennock
2014-04-02 0:50 ` Erik Johnson
2014-04-02 20:54 ` Phil Pennock
2014-04-02 21:11 ` Erik Johnson
2014-04-02 9:23 ` Peter Stephenson [this message]
2014-04-02 19:06 ` Erik Johnson
2014-04-02 20:58 ` Peter Stephenson
2014-04-02 21:14 ` Erik Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140402102348.4ceeddad@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=palehose@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).