Debian bug report logs - #939, boring messages


Message sent to debian-devel@pixar.com:


Subject: Bug#939: wall (and others?) ignore ut_type (was: Bug#709: Funny message from `wall')
Reply-To: iwj10@cus.cam.ac.uk (Ian Jackson), debian-bugs@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: iwj10@cus.cam.ac.uk (Ian Jackson)
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Fri, 02 Jun 1995 19:33:06 GMT
Resent-Message-ID: <debian-bugs-handler.939.060219194728681@pixar.com>
X-Debian-PR-Package: bsdutils
X-Debian-PR-Keywords: 
Received: via spool for debian-bugs; Fri, 02 Jun 1995 19:33:06 GMT
Received: with rfc822 via encapsulated-mail id 060219194728681;
          Fri, 02 Jun 1995 19:19:47 GMT
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sHcAA-0006DQC; Fri, 2 Jun 95 12:13 PDT
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA04427
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Fri, 2 Jun 1995 12:12:09 -0700
Received: by bootes.cus.cam.ac.uk
	(Smail-3.1.29.0 #36) id m0sHc9u-000BzzC; Fri, 2 Jun 95 20:13 BST
Received: by chiark
	id <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
	(Debian /\oo/\ Smail3.1.29.1 #29.31); Fri, 2 Jun 95 18:47 BST
Message-Id: <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
Date: Fri, 2 Jun 95 18:47 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: Debian bugs submission address <debian-bugs@pixar.com>
In-Reply-To: <m0sGrsF-0007avC@grus.cus.cam.ac.uk>
References: <m0sGrcl-00002oC@debra.debian.org>
	<m0rvOi6-0000YUZ.ijackson@nyx.cs.du.edu>
	<m0sGrsF-0007avC@grus.cus.cam.ac.uk>

Package: bsdutils
Version: 1.2-1

The `wall' program from the bsdutils uses an incorrect algorithm to
skip inappropriate entries in the utmp file.

It uses getpwnam on the ut_user field, and ignores the entry if
getpwnam fails.

I submit that it should instead use the ut_type field - in particular,
it should ignore entries whose ut_type is anything other than
USER_PROCESS.

This bug probably has no immediate adverse consequences; however, it
may do so in the future.  The manpage does not specify what the
contents of the ut_user field are if its meaning is not applicable to
the entry in question; usually a lack of such a specification means
that the field may contain garbage, and it is possible that when some
programs modify the utmp they leave an `old' username in this field.
IMO this would be legal, if rather unwise.  It would break the
algorithm used in bsdutils-1.2-1.

I submitted these details as a piece of additional information on my
original bug report (#709) - the relevant message is below.  Note in
particular the quote from the utmp(5) manpage, which makes special
mention of the fact that BSD-based programs may interpret the utmp
file incorrectly (implying that they should be modified to check
ut_type).

This problem probably occurs elsewhere in the bsdutils package; I
don't have time to check all of the sources there.  All the packages
which read utmp should be checked and corrected if necessary.

Ian.

------- start of forwarded message (RFC 934 encapsulation) -------
In-Reply-To: <m0s3YVn-00001tC@debian.org>
References: <m0rvOi6-0000YUZ.ijackson@nyx.cs.du.edu>
	<m0s3YVn-00001tC@debian.org>
To: debian-bugs@Pixar.com
Subject: Re: Bug#709: Funny message from `wall'

Ian Murdock writes ("Re: Bug#709: Funny message from `wall'"):
> Okay... I've found the cause of the bug.  Apparently, sysvinit writes
> a "runlevel" entry to /var/run/utmp (apparently with ut_line = "~"),
> and when wall attempts to open the device so it can write the message
> to it, wall complains "/dev/~: No such file or directory" when it can-
> not.
>
> I'm not sure what to do about this.  Comments?  Ideas?

I think a runlevel entry in /var/run/utmp is an excellent idea.
`wall' should be taught to ignore entries that aren't appropriate.

What are the other fields in the utmp entry like ?  According to
utmp(5), there is an ut_type field, with values like:
              #define UT_UNKNOWN            0
              #define RUN_LVL               1
              #define BOOT_TIME             2
              #define NEW_TIME              3
              #define OLD_TIME              4
              #define INIT_PROCESS          5
              #define LOGIN_PROCESS         6
              #define USER_PROCESS          7
              #define DEAD_PROCESS          8

I haven't looked, but it seems likely to me that sysvinit writes
records with a type of RUN_LVL, which `wall' should clearly know to
ignore.

This may also shed some light on the related problem of the `wall'
messages on getty-but-not-logged-in terminals.  Presumably those have
a type of `LOGIN_PROCESS' or some such, which `wall' should also
ignore.

In fact, according to utmp(5):

NOTES
       The v7/BSD-like file format lacks some fields, most impor-
       tantly  it  lacks ut_type, which causes native v7/BSD-like
       programs to display, for example, dead or login entries.

Ian.
------- end -------


Message sent:


From: iwj10@thor.cam.ac.uk (Ian Jackson)
To: iwj10@cus.cam.ac.uk (Ian Jackson)
Subject: Bug#939: Acknowledgement (was: wall (and others?) ignore ut_type (was: Bug#709: Funny message from `wall'))
In-Reply-To: <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
References: <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>

Thank you for the problem report you have sent regarding Debian GNU/Linux.
This is an automatically generated reply, to let you know your message has
been received.  It is being forwarded to the developers' mailing list for
their attention; they will reply in due course.

If you wish to submit further information on your problem, please send
it to debian-bugs@pixar.com, but please ensure that the Subject
line of your message starts with "Bug#939" or "Re: Bug#939" so that
we can identify it as relating to the same problem.

Please do not reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.

Ian Jackson
(maintainer, debian-bugs)


Message sent:


From: iwj10@thor.cam.ac.uk (Ian Jackson)
To: imurdock@debian.org (Ian Murdock)
In-Reply-To: <m0sP1BK-0001cqC@debian.org>
References: <m0sP1BK-0001cqC@debian.org> <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
Subject: Bug#939: marked as done (was: wall (and others?) ignore ut_type (was: Bug#709: Funny message from `wall'))

Your message dated Fri, 23 Jun 95 00:21 EST
with message-id <m0sP1BK-0001cqC@debian.org>
and subject line Bug#939:
has caused the attached bug report to be marked as done.

It is your now responsibility to ensure that the bug report is dealt
with.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Ian Jackson
(maintainer, debian-bugs)

Received: with rfc822 via encapsulated-mail id 060219194728681;
          Fri, 02 Jun 1995 19:19:47 GMT
From cus.cam.ac.uk!iwj10 Fri Jun  2 12:13:42 1995
Return-Path: <iwj10@cus.cam.ac.uk>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sHcAA-0006DQC; Fri, 2 Jun 95 12:13 PDT
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA04427
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Fri, 2 Jun 1995 12:12:09 -0700
Received: by bootes.cus.cam.ac.uk
	(Smail-3.1.29.0 #36) id m0sHc9u-000BzzC; Fri, 2 Jun 95 20:13 BST
Received: by chiark
	id <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
	(Debian /\oo/\ Smail3.1.29.1 #29.31); Fri, 2 Jun 95 18:47 BST
Message-Id: <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
Date: Fri, 2 Jun 95 18:47 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: Debian bugs submission address <debian-bugs@pixar.com>
Subject: wall (and others?) ignore ut_type (was: Bug#709: Funny message from `wall')
In-Reply-To: <m0sGrsF-0007avC@grus.cus.cam.ac.uk>
References: <m0sGrcl-00002oC@debra.debian.org>
	<m0rvOi6-0000YUZ.ijackson@nyx.cs.du.edu>
	<m0sGrsF-0007avC@grus.cus.cam.ac.uk>

Package: bsdutils
Version: 1.2-1

The `wall' program from the bsdutils uses an incorrect algorithm to
skip inappropriate entries in the utmp file.

It uses getpwnam on the ut_user field, and ignores the entry if
getpwnam fails.

I submit that it should instead use the ut_type field - in particular,
it should ignore entries whose ut_type is anything other than
USER_PROCESS.

This bug probably has no immediate adverse consequences; however, it
may do so in the future.  The manpage does not specify what the
contents of the ut_user field are if its meaning is not applicable to
the entry in question; usually a lack of such a specification means
that the field may contain garbage, and it is possible that when some
programs modify the utmp they leave an `old' username in this field.
IMO this would be legal, if rather unwise.  It would break the
algorithm used in bsdutils-1.2-1.

I submitted these details as a piece of additional information on my
original bug report (#709) - the relevant message is below.  Note in
particular the quote from the utmp(5) manpage, which makes special
mention of the fact that BSD-based programs may interpret the utmp
file incorrectly (implying that they should be modified to check
ut_type).

This problem probably occurs elsewhere in the bsdutils package; I
don't have time to check all of the sources there.  All the packages
which read utmp should be checked and corrected if necessary.

Ian.

------- start of forwarded message (RFC 934 encapsulation) -------
In-Reply-To: <m0s3YVn-00001tC@debian.org>
References: <m0rvOi6-0000YUZ.ijackson@nyx.cs.du.edu>
	<m0s3YVn-00001tC@debian.org>
To: debian-bugs@Pixar.com
Subject: Re: Bug#709: Funny message from `wall'

Ian Murdock writes ("Re: Bug#709: Funny message from `wall'"):
> Okay... I've found the cause of the bug.  Apparently, sysvinit writes
> a "runlevel" entry to /var/run/utmp (apparently with ut_line = "~"),
> and when wall attempts to open the device so it can write the message
> to it, wall complains "/dev/~: No such file or directory" when it can-
> not.
>
> I'm not sure what to do about this.  Comments?  Ideas?

I think a runlevel entry in /var/run/utmp is an excellent idea.
`wall' should be taught to ignore entries that aren't appropriate.

What are the other fields in the utmp entry like ?  According to
utmp(5), there is an ut_type field, with values like:
              #define UT_UNKNOWN            0
              #define RUN_LVL               1
              #define BOOT_TIME             2
              #define NEW_TIME              3
              #define OLD_TIME              4
              #define INIT_PROCESS          5
              #define LOGIN_PROCESS         6
              #define USER_PROCESS          7
              #define DEAD_PROCESS          8

I haven't looked, but it seems likely to me that sysvinit writes
records with a type of RUN_LVL, which `wall' should clearly know to
ignore.

This may also shed some light on the related problem of the `wall'
messages on getty-but-not-logged-in terminals.  Presumably those have
a type of `LOGIN_PROCESS' or some such, which `wall' should also
ignore.

In fact, according to utmp(5):

NOTES
       The v7/BSD-like file format lacks some fields, most impor-
       tantly  it  lacks ut_type, which causes native v7/BSD-like
       programs to display, for example, dead or login entries.

Ian.
------- end -------


Message sent:


From: iwj10@thor.cam.ac.uk (Ian Jackson)
To: iwj10@cus.cam.ac.uk (Ian Jackson)
Subject: Bug#939 acknowledged by developer (was: wall (and others?) ignore ut_type (was: Bug#709: Funny message from `wall'))
References: <m0sP1BK-0001cqC@debian.org> <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>
In-Reply-To: <m0sHaom-0000YDZ@chiark.al.cl.cam.ac.uk>

This is an automatic notification regarding your bug report.

Responsibility for it has been taken by one of the developers, namely
imurdock@debian.org (Ian Murdock).

You should be hearing from them with a substantive response shortly, if
you have not already done so.  If not, please contact them directly,
or email debian-bugs@pixar.com or myself.

Ian Jackson
(maintainer, debian-bugs)


Ian Jackson / iwj10@thor.cam.ac.uk, with the debian-bugs tracking mechanism
This page last modified 07:13:02 GMT Fri 23 Jun