delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/06/25/20:44:53

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SARE_FREE_WEBM_LAPOSTE,TW_BX,TW_IB,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4C254D71.7050205@laposte.net>
Date: Sat, 26 Jun 2010 02:44:33 +0200
From: Cyrille Lefevre <cyrille DOT lefevre-lists AT laposte DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: history (was Re: base-files: LOGNAME)
References: <4C021FA8 DOT 4030403 AT users DOT sourceforge DOT net> <AANLkTilUfdSyZF6bVEKHCqImBF62vIu8aV2SNq2cx6xI AT mail DOT gmail DOT com> <20100531081825 DOT GF16885 AT calimero DOT vinschen DOT de> <AANLkTikWtsAkY6ZasbF3ihfjtLVXBxkHDNN-Zj3AhQoL AT mail DOT gmail DOT com>
In-Reply-To: <AANLkTikWtsAkY6ZasbF3ihfjtLVXBxkHDNN-Zj3AhQoL@mail.gmail.com>
X-me-spamlevel: not-spam
X-me-spamrating: 42.020203
X-me-spamcause: OK, (10)(0000)gggruggvucftvghtrhhoucdtuddrvdelhedrtddvucetggdotefuucfrrhhofhhilhgvmecuoehnohhnvgeqnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddvtddmnehlohhgihhnucdlqddvtddmnehlohhgihhnucdlqddvtddmnehnohcuhhhoshhtuchurhhlucdlfedtmd
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Le 31/05/2010 13:22, Andy Koppe a =C3=A9crit :
<snip>
> Posix defines LOGNAME, but regarding USER it only says that it is
> "unwise to conflict with certain variables that are frequently
> exported by widely used command interpreters and applications".
> (http://opengroup.org/onlinepubs/007908799/xbd/envvar.html)

FYI only, in short :

historically, USER is the bsd variant of the sysv LOGNAME.

long...

sunos, login(1) both set USER and LOGNAME using pwd->pw_name
also, logname(1) uses cuserid(3) instead of getlogin(3)
cuserid(3) does getpwuid(geteuid()) || getlogin() || NULL
funny, logname(3) does getenv("LOGNAME") in libxpg !

solaris, login(1) only set LOGNAME
logname(1) does getlogin(3)

in both case, getlogin(3) does an utmp lookup using
a kind of ttyslot() * sizeof(struct utmp) || NULL

sys5r4, same as solaris, but
getlogin(3) does an utmp lookup using a kind
of a while getsid(0) !=3D utmp.ut_pid loop
cuserid(3) does a getlogin(3) || getpwuid(getuid()) || NULL

irix, login(1) and logname(1) does as sunos
getlogin(2) does an utmp lookup using a kind
of a while ttyname(0||1||2) =3D=3D utmp.ut_line
cuserid(3) does as sys5r4

osf1, login(1) does as sunos, logname(1) as solaris
getlogin(1) does a syscall _getlogin(2)
cuserid(3) does as getpwuid(getuid()) || NULL

Regards,

Cyrille Lefevre
--=20
mailto:Cyrille DOT Lefevre-lists AT laposte DOT net



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019