Re: is hard-coding the group name, "tty", portable enough for who -a?
From:
Jim Meyering
Subject:
Re: is hard-coding the group name, "tty", portable enough for who -a?
Date:
Fri, 11 Jul 2008 13:59:34 +0200
Matthew Woehlke <address@hidden> wrote:
> Jim Meyering wrote:
>> If anyone can find a system on which this prints
>> something other than "tty", please let us know:
>>
>> stat --format %G $(tty)
>
> I get my primary GID on AIX 4.3 and Irix 6.5, and "terminal" on OSF1
> 5.1. The OSS I have access to probably isn't a "reasonable porting
> target" :-), and the other systems I can think of that I could test
> are BSD-ish, Linux, HP-UX, or Solaris, which you tested already.
Thanks for checking.
With those two exceptions, it's clear I can't apply the patch as-is.
And making who look at e.g., the installed write binary to see
what group it is set-GID-to doesn't sound any better. Nor is it
practical/desirable to install who as a set-GID binary (how do you
reliably determine what group ID to use?)
It's starting to look like the cost/benefit ratio is too high,
so I don't expect to spend time on this.
However, if someone can propose a portable and reliable test
for that attribute, I'll be happy to consider it.