Bug 9579 - Непонятное поведение who и users
Summary: Непонятное поведение who и users
Status: CLOSED NOTABUG
Alias: None
Product: Sisyphus
Classification: Development
Component: coreutils (show other bugs)
Version: unstable
Hardware: all Linux
: P2 minor
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 00:03 MSD by Artem Delendik
Modified: 2009-05-10 09:33 MSD (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Delendik 2006-05-17 00:03:14 MSD
Непонятное поведение who (см.
http://lists.altlinux.ru/pipermail/sisyphus/2005-May/060321.html
http://lists.altlinux.org/pipermail/sisyphus/2005-May/060381.html
подтверждается и проявляется аналогичным образом в users.
Предпосылки:
в coreutils-5.94/lib/readutmp.c , line 107, добавили вызов ф-ции:
<skip>
if (desirable_utmp_entry (u, options))
<skip>
для отбора записей utmp по определенным критериям

Причина:
в coreutils-5.94/lib/users.c , line 138,
<skip>
   switch (argc - optind)
    {
    case 0:                     /* users */
      users (UTMP_FILE, READ_UTMP_CHECK_PIDS);
                        ^^^^^^^^^^^^^^^^^^^^^
                        вызов users без параметров,
                        параметр READ_UTMP.... == 1
      break;

    case 1:                     /* users <utmp file> */
      users (argv[optind], 0);
      ^^^^^^^^^^^^^^^^^^^^^^^
      а вот здесь при users <utmp file>
      подставляется "0" и выводится все записи.

      break;
<skip>

Аналогично в coreutils-5.94/src/who.c, line 815
<skip>
    case 0:                     /* who */
      who (UTMP_FILE, READ_UTMP_CHECK_PIDS);
      break;

    case 1:                     /* who <utmp file> */
      who (argv[optind], 0);
      break;

<skip>

Спрашивается:
а) зачем добавлено такое поведение?
б) почему не сказано ничего в man ?
в) это бага? Или фича?