bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH v2] who --mesg now checks the group of TTY devices


From: Jim Meyering
Subject: Re: [PATCH v2] who --mesg now checks the group of TTY devices
Date: Fri, 22 Jan 2010 17:03:51 +0100

Kamil Dudka wrote:
> Hi Jim,
>
> attached is the second version of the patch.
>
> On Thursday 21 of January 2010 13:04:27 Jim Meyering wrote:
>> >> It would be helpful to say how to determine the appropriate group name.
>> >> Something like "ls -lg /dev/tty" or
>> >>     $ stat --format %G /dev/tty
>> >>     tty
>> >
>> > Do you mean directly in the help string or somewhere else?
>>
>> I was thinking of a comment in the .m4 file,
>> but now that you mention the help string, perhaps that's better.
>> You choose.
>
> Well, let it be a shell comment then.
>
>> You're right that we go to extremes to avoid in-functions #ifdefs.
>> In-function #ifdefs are evil, but so is code duplication.
>> It's a trade-off.  Since this function is so small,
>> and the fraction of duplicated code would have been so high,
>> the in-function #ifdef is clearly the lesser evil.

Thanks!

Can you reproduce the situation in which this new configure-time
option is required on e.g., Fedora 12?  So far, I haven't been able to,
since all tty devices properly get the "tty" group, and in that
case, the simple perm-comparison test is adequate.

I realized that I didn't really remember the details,
and NEWS didn't tell me enough, so started rewriting it:

  who: the "+/-" --mesg (-T) indicator of whether a user/tty is accepting
  messages could be incorrectly listed as "+", when in fact, the user was
  not accepting messages (mesg no).  Before, who would examine only the
  permission bits, and not consider the group of the TTY device file.
  Thus, when a tty file's group would change somehow e.g., to "root",
  that would make it unwritable (via write(1)) by normal users, in spite
  of whatever the permission bits might imply.  Now, when configured
  using the --with-tty-group[=NAME] option, who also compares the group
  of the TTY device with NAME (or "tty" if no group name is specified).

How can the group name change (or be set initially) to other than "tty"?
I suspect this is an issue only on older systems.  If so, I need to
say that in NEWS, rather than "somehow".

Other than that, everything looks fine (I moved the "const").




reply via email to

[Prev in Thread] Current Thread [Next in Thread]