All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Laurent Bigonville <bigon@debian.org>, selinux@tycho.nsa.gov
Subject: Re: chcat is using getlogin() function that sometimes returns null/empty string
Date: Mon, 7 Dec 2015 14:57:21 -0500	[thread overview]
Message-ID: <5665E4A1.50108@tycho.nsa.gov> (raw)
In-Reply-To: <5665C991.4030606@debian.org>

On 12/07/2015 01:01 PM, Laurent Bigonville wrote:
> Hi,
>
> So apparently gnome-terminal developers have decided to stop updating
> utmp[0] file and this is breaking chcat -Ll with the following error:
>
> Traceback (most recent call last):
>    File "/usr/bin/chcat", line 409, in <module>
>      sys.exit(listusercats(cmds))
>    File "/usr/bin/chcat", line 352, in listusercats
>      users.append(os.getlogin())
> OSError: [Errno 2] No such file or directory
>
> getlogin(3) manpage suggest to rely on the LOGNAME environment variable,
> so maybe chcat should fallback to this if getlogin() is not returning
> anything?
>
> Cheers,
>
> Laurent Bigonville
>
> [0] https://bugzilla.gnome.org/show_bug.cgi?id=747046

Maybe just use:
pwd.getpwuid(os.getuid()).pw_name

      reply	other threads:[~2015-12-07 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 18:01 chcat is using getlogin() function that sometimes returns null/empty string Laurent Bigonville
2015-12-07 19:57 ` Stephen Smalley [this message]

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=5665E4A1.50108@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=bigon@debian.org \
    --cc=selinux@tycho.nsa.gov \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.