From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18636 invoked by alias); 2 Apr 2014 21:15:06 -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: 32523 Received: (qmail 21736 invoked from network); 2 Apr 2014 21:14:50 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4CvtbSSU8lLMVGCwM7WnssPFZpDuWINw25GMLtGv+bE=; b=0vJYuKhsgOHOSJK8nA1O7rSj4pJ3j+e2X0NezqSx5qHYIMQ/8KeRZsss7q2sIBS4MN RhBZAilcqgNcapGhg/08YJ/8cvfZVEo4dsvB+aD6brBTTB5mluyHKIX7IsCexXeu198T kDhTW5k+q9c4L7KrmZnOQ+thGPMQ86AGlO9TaykXHDKHdDF8jUkj5l/IE0JJKllsyNtV olj52VQgKgytpRSm7YbJ71QAIM3y5gm+y8sGGP+zAKDZk6pps2hq4ruvXNrL+03MZCtZ btJoH4/ipvp8e/oJ2NXiqQ5U0HDKNXvNJT7mSq3ICvgARIerY8rSjTssng/RGlaJOYVS qQAQ== X-Received: by 10.60.140.201 with SMTP id ri9mr1961759oeb.74.1396473288713; Wed, 02 Apr 2014 14:14:48 -0700 (PDT) Date: Wed, 2 Apr 2014 16:14:45 -0500 From: Erik Johnson To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: LOGNAME not properly set on FreeBSD Message-ID: <20140402211445.GA20484@gmail.com> References: <20140401212239.GE20508@gmail.com> <20140402102348.4ceeddad@pwslap01u.europe.root.pri> <20140402190621.GA5323@gmail.com> <20140402215854.6012692f@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20140402215854.6012692f@pws-pc.ntlworld.com> User-Agent: Mutt/1.5.23 (2014-03-12) --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 09:58:54PM +0100, Peter Stephenson wrote: >On Wed, 2 Apr 2014 14:06:21 -0500 >Erik Johnson wrote: >> Python os.getlogin() does indeed show "erik" instead of "root". So this >> may just be a difference between glibc and BSD libc. Either way, it >> "just works" in bash, sh, csh, tcsh, and ksh, as can be seen below, so >> I believe there is an argument for making it work properly in FreeBSD as >> well, or at the very least adding some wording to the zshparam manpage >> which makes this difference in behavior clear. > >Hmm... to me, having LOGNAME *not* report the same as getlogin() is >"just not working". Presumably there's some reason why getlogin() does >what it does and it doesn't seem to me to be the shell's job to second >guess system calls. POSIX seems to agree with me --- to be fair, this >isn't for the variable, it's for the command "logname", but it would be >confusing if they were different. > > The logname utility shall write the user's login name to standard > output. The login name shall be the string that would be returned by > the getlogin() function defined in the System Interfaces volume of > POSIX.1-2008. Under the conditions where the getlogin() function would > fail, the logname utility shall write a diagnostic message to standard > error and exit with a non-zero exit status. > >However, there may be some documented prior art for LOGNAME that I'm >missing --- the history of shell development isn't necessarily particularly >rational. > >It certainly makes sense to document it in any case. > Yeah, and for what it's worth it seems that not all of the shells are exporting LOGNAME. But the ones that do are apparently doing so differently than zsh does it. So, documentation is probably the best route to go here. Thanks! --=20 -Erik "For me, it is far better to grasp the universe as it really is than to persist in delusion, however satisfying and reassuring." --Carl Sagan --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlM8fcUACgkQXlWDxDeAjz9wwACfe9Mrj8jhoCXnlGP7oVHpTCcd qJQAnjPGxwFlUnZyXFJ7HNCuMMkpt218 =+Geh -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--