GNU bug report logs - #48894
ambiguous descriptions of logname and whoami

Previous Next

Package: coreutils;

Reported by: Christoph Anton Mitterer <calestyo <at> scientia.net>

Date: Mon, 7 Jun 2021 01:50:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48894 in the body.
You can then email your comments to 48894 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#48894; Package coreutils. (Mon, 07 Jun 2021 01:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christoph Anton Mitterer <calestyo <at> scientia.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 07 Jun 2021 01:50:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo <at> scientia.net>
To: bug-coreutils <at> gnu.org
Subject: ambiguous descriptions of logname and whoami
Date: Mon, 07 Jun 2021 03:49:28 +0200
Hey.

Man page of logname say:
"Print the name of the current user."

IMO that's ambiguous as it's probably ought to be the name returned by
getlogin().

So when I login as normal user, and "su -" to root, logname won't print
"root" but the normal user.
However, what most people will understand under the "the current user"
would be root, in that case.



Man AND info pages of whoami say:
"print effective userid"

However, it's the user name, that is printed, not the userid (which
most people will understand as the numerical UID).


Cheers,
Chris.





Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Wed, 15 Sep 2021 14:29:01 GMT) Full text and rfc822 format available.

Notification sent to Christoph Anton Mitterer <calestyo <at> scientia.net>:
bug acknowledged by developer. (Wed, 15 Sep 2021 14:29:02 GMT) Full text and rfc822 format available.

Message #10 received at 48894-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Christoph Anton Mitterer <calestyo <at> scientia.net>,
 48894-done <at> debbugs.gnu.org
Subject: Re: bug#48894: ambiguous descriptions of logname and whoami
Date: Wed, 15 Sep 2021 15:28:38 +0100
On 07/06/2021 02:49, Christoph Anton Mitterer wrote:
> Hey.
> 
> Man page of logname say:
> "Print the name of the current user."
> 
> IMO that's ambiguous as it's probably ought to be the name returned by
> getlogin().
> 
> So when I login as normal user, and "su -" to root, logname won't print
> "root" but the normal user.
> However, what most people will understand under the "the current user"
> would be root, in that case.
> 
> 
> 
> Man AND info pages of whoami say:
> "print effective userid"
> 
> However, it's the user name, that is printed, not the userid (which
> most people will understand as the numerical UID).

Fixed with: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=f76a56831

thanks!
Pádraig




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Oct 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.