ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Artem <x-console@yandex.ru>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] coreutils, who )
Date: Tue, 16 May 2006 23:39:06 +0300
Message-ID: <446A386A.9050908@yandex.ru> (raw)
In-Reply-To: <20060516143556.GC6226@basalt.office.altlinux.org>

Dmitry V. Levin wrote:
> On Tue, May 16, 2006 at 10:04:08AM +0300, Artem wrote:
> 
>>Michael A. Kangin wrote:
>>
>>>On 16 мая 2006 01:37 Artem <x-console@yandex.ru> wrote:
>>>
>>>
>>>>Да, я уже нашел _одну_ строчку  в coreutils-xxx/libs/readutmp.c из-за
>>>>которой эта вещь происходит. 
>>>
>>Эта информация скорее уже к coreutils@ . Описанное поведение who (см.
>>тред) аналогично проявляется и в 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 ?
>>в) это бага? Или фича?
> 
> 

https://bugzilla.altlinux.org/show_bug.cgi?id=9579

> 2005-03-30  Paul Eggert  <eggert@cs.ucla.edu>
> 
>         * src/pinky.c (short_pinky): Adjust to read_utmp signature change.
>         * src/uptime.c (uptime): New arg OPTIONS.  All uses changed.
>         * src/users.c (users): Likewise.
>         * src/who.c (who): Likewise.
>         * src/uptime.c (main): Check PIDs when invoked with zero arguments.
>         * src/users.c (main): Likewise.
>         * src/who.c (main): Likewise.  Also with two arguments.
>         Omit duplicate code in 2-arg case.
>         (UT_PID): Moved to ../lib/readutmp.h.
> 

В принципе, wttyhx правится элементарно заменой "who" на
"who /var/run/utmp" . Что я для себя и сделал.


Rgds, Artem.


  reply	other threads:[~2006-05-16 20:39 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09 21:40 [sisyphus] ничего не понимаю... ( powersave ) Artem
2006-05-10 10:07 ` Anton Farygin
2006-05-10 16:21     ` Anton Farygin
2006-05-10 16:47       ` Artem
2006-05-11  6:03         ` Anton Farygin
2006-05-11 10:41           ` Artem
2006-05-11 12:27             ` Anton Farygin
2006-05-15 14:12           ` Artem
2006-05-15 15:44             ` Anton Farygin
2006-05-15 18:05               ` Artem
2006-05-15 18:28                 ` Anton Farygin
2006-05-15 20:27                 ` Michael A. Kangin
2006-05-15 21:37                   ` [sisyphus] coreutils, who ) Artem
2006-05-16  2:24                     ` Michael A. Kangin
2006-05-16  7:04                       ` Artem
2006-05-16  8:13                         ` Anton Farygin
2006-05-16 13:39                           ` Dmitry V. Levin
2006-05-16 14:01                             ` Anton Farygin
2006-05-16 14:28                               ` Dmitry V. Levin
2006-05-16 17:19                                 ` Anton Farygin
2006-05-21  8:33                               ` [sisyphus] /usr/lib/powersave/wttyhx -> /usr/bin/wttyhx? Michael Shigorin
2006-05-22  5:02                                 ` Anton Farygin
2006-05-16 14:35                         ` [sisyphus] coreutils, who ) Dmitry V. Levin
2006-05-16 20:39                           ` Artem [this message]
2006-05-16 21:06                             ` Dmitry V. Levin
2006-05-16 21:31                               ` Artem
2006-05-16 21:36                                 ` Artem
2006-05-16 22:12                                   ` Michael A. Kangin
2006-05-16 22:16                                     ` Dmitry V. Levin
2006-05-16 23:46                                       ` Ivan Adzhubey
2006-05-16 23:59                                         ` Dmitry V. Levin
2006-05-17 22:25                                           ` Ivan Adzhubey
2006-05-17 22:53                                             ` Dmitry V. Levin
2006-05-17 23:13                                               ` Artem
2006-05-17  5:51                                       ` Anton Farygin
2006-05-16 22:14                                   ` Dmitry V. Levin
2006-05-16 22:23                                     ` Artem
2006-05-16 23:05                                       ` Dmitry V. Levin
2006-05-17  6:15                                         ` Artem
2006-05-17 23:12                                           ` Artem
2006-05-17 23:26                                             ` Dmitry V. Levin
2006-05-18  5:26                                               ` Artem
2006-05-21  8:32                       ` [sisyphus] [JT] " Michael Shigorin

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=446A386A.9050908@yandex.ru \
    --to=x-console@yandex.ru \
    --cc=sisyphus@lists.altlinux.org \
    /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

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git