[systemd-devel] Mounting /dev/pts

Gustavo Sverzut Barbieri barbieri at profusion.mobi
Mon Jan 3 16:24:53 PST 2011


On Mon, Jan 3, 2011 at 10:22 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Tue, 04.01.11 01:14, Michael Biebl (mbiebl at gmail.com) wrote:
>
>> > Hmm, I normally would be happy to do that, but I am a bit concerned
>> > about the gid=tty parameter. Before we pass that off to the kernel we'd
>> > have to look that up and pass a numeric gid on. But doing NSS queries
>> > from PID 1 is a little bit dangerous. Hence I'd actually prefer if
>> > people apply this in /etc/fstab.
>> >
>> > Ideas? Suggestions?
>>
>> The mountdevsubfs init script does indeed use a numeric value (= 5)
>> for gid as that is guaranteed to be tty on Debian.
>> I just checked a Ubuntu 10.10,  Fedora 14 and openSUSE 11.4 system and
>> they all use tty:5.
>>
>> If this is an assumption though that can be safely made accros distros, I dunno.
>
> Hmm, we could lookup the ID in a configure check at build time which
> fails if the "tty" group doesn't exist. I guess that wouldn't be too
> bad. Might have weird effects on cross-compilation possibly -- but if we
> provide --with-tty-gid= as configure parameter this should be fine.
>
> Anybody has a good reason why we shouldn't solve this with a
> compile-time NSS lookup?

don't complicate things, let's keep our regular "do the simple way,
let's people report corner cases". It was done for other things, why
not this? At most define a macro:

#ifndef TTY_GID
#define TTY_GID 5
#endif

and people can still provide it using CFLAGS.


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbieri at gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202


More information about the systemd-devel mailing list