[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#932384: marked as done (libc6: utmp broken)



Your message dated Fri, 19 Jul 2019 14:44:53 +0200
with message-id <20190719124453.GB2295@aurel32.net>
and subject line Re: Bug#932384: libc6: utmp broken
has caused the Debian Bug report #932384,
regarding libc6: utmp broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
932384: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932384
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.28-10
Severity: important

After hitting #932380 I looked at the source code of GNU screen,
saw it uses the getutline(3) function, and compiled the example
from its manpage.

The output is not what I expected:

tglase@tglase:~ $ ./a.out
before adding entry:
tglase   :0           2019-07-18 16:07
after adding entry:
tglase   :0           2019-07-18 16:07
after removing entry:
tglase   :0           2019-07-18 16:07

This is the same, no matter whether I’m in GNU screen in xterm,
or just in xterm, or even on the Linux text console:

tglase@tglase:~ $ ./a.out
before adding entry:
tglase   tty2         2019-07-18 17:25
tglase   :0           2019-07-18 16:07
after adding entry:
tglase   tty2         2019-07-18 17:25
tglase   :0           2019-07-18 16:07
after removing entry:
tglase   tty2         2019-07-18 17:25
tglase   :0           2019-07-18 16:07

utmp entries cannot be added (and the GNU screen source code contains
curse^Wcomplaints about the GNU API for utmp lacking the ability to
return success/error information, so the applications cannot even de‐
tect this!), while the file is set up correctly:

tglase@tglase:~ $ ll /var/run/utmp
-rw-r--r-- 1 root utmp 4608 Jul 18 17:26 /var/run/utmp
tglase@tglase:~ $ w | cat
 17:27:33 up  1:21,  1 user,  load average: 1.35, 1.68, 2.12
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
tglase   :0       -                16:07   ?xdm?  14:24   0.03s /usr/bin/ck-launch-session /usr/bin/monkeysphere-validation-agent /bin/mksh /usr/share/tarent/autokde.d/loadenv.sh icewm-session


-- System Information:
Debian Release: bullseye/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable'), (100, 'experimental')
Architecture: x32 (x86_64)
Foreign Architectures: i386, amd64

Kernel: Linux 4.19.0-5-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)

--- End Message ---
--- Begin Message ---
control: severity 932384 important

On 2019-07-18 17:28, Thorsten Glaser wrote:
> Package: libc6
> Version: 2.28-10
> Severity: important

I fail to see how this bug has a major effect on the usability of the
glibc.

> After hitting #932380 I looked at the source code of GNU screen,
> saw it uses the getutline(3) function, and compiled the example
> from its manpage.

No it doesn't. It uses libutempter, which provides a setgid utmp binary
do to the job.

> The output is not what I expected:
> 
> tglase@tglase:~ $ ./a.out
> before adding entry:
> tglase   :0           2019-07-18 16:07
> after adding entry:
> tglase   :0           2019-07-18 16:07
> after removing entry:
> tglase   :0           2019-07-18 16:07
> 
> This is the same, no matter whether I’m in GNU screen in xterm,
> or just in xterm, or even on the Linux text console:
> 
> tglase@tglase:~ $ ./a.out
> before adding entry:
> tglase   tty2         2019-07-18 17:25
> tglase   :0           2019-07-18 16:07
> after adding entry:
> tglase   tty2         2019-07-18 17:25
> tglase   :0           2019-07-18 16:07
> after removing entry:
> tglase   tty2         2019-07-18 17:25
> tglase   :0           2019-07-18 16:07
> 
> utmp entries cannot be added (and the GNU screen source code contains
> curse^Wcomplaints about the GNU API for utmp lacking the ability to
> return success/error information, so the applications cannot even de‐
> tect this!), while the file is set up correctly:
> 
> tglase@tglase:~ $ ll /var/run/utmp
> -rw-r--r-- 1 root utmp 4608 Jul 18 17:26 /var/run/utmp

That's the issue, you need to have write access to the utmp file to be
able to update it (and also read access to read it). There is no magic
involved, the file and the function obey to the standard unix
permissions.

Therefore there is no bug, neither in glibc nor in the manpage. Closing
it.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: