Re: devfs question

From: Khimenko Victor (khim@sch57.msk.ru)
Date: Wed Jul 19 2000 - 14:34:54 EST


In <Pine.LNX.4.21.0007191114570.12193-100000@bliss.penguinpowered.com> Forever shall I be. (zinx@linuxfreak.com) wrote:
Fb> Khimenko Victor wrote:

>>
>>
>> On Tue, 18 Jul 2000, Richard Gooch wrote:
>>
>> > Andrew Pimlott writes:
>> > > On Tue, Jul 18, 2000 at 06:20:07PM -0400, Richard Gooch wrote:
>> > > > Andrew Pimlott writes:
>> > > > > Perhaps best to look for a purely numerical last component, and in
>> > > > > that case take the last two components.
>> > > >
>> > > > That would break the old names. "/dev/tty1" would not match to "tty1".
>> > >
>> > > I'm sorry, I meant fall back to the old logic if the last component
>> > > of the path is not purely numerical.
>> >
>> > You mean if all characters after the last '/' are numeric, match on
>> > the last two path components?
>> > Yeah, I guess that would work. It seems a little hacky, but then again
>> > so are the other solutions.
>> >
>> In fact I think it's pretty good solution :-) You need ability to
>> distingush /dev/pts/0 , /dev/vc/0 and [perhaps] /devfs/x/y/z/0 or
>> /usb/A/B/C/0 while retaining compatibility with old scheme (where
>> /dev/tty1 is just tty1 ). It works:
>>
>> /dev/tty1 => tty1
>> /dev/pts/0 => pts/0
>> /dev/vc/0 => vc/0
>> /devfs/x/y/z/0 => /devfs/x/y/z/0
>> /usb/A/B/C/0 => /usb/A/B/C/0
>>
>> All is pretty clear: if your device is in /dev then strip /dev and use
>> path relative to /dev, if not - use full name. To me it looks better then
>> any other scheme (it's possible to make a clash if you'll create
>> /dev/devfs/x/y/z/0 AND you'll use /dev//devfs/x/y/z/0 in inittab; in this
>> situation answer is simple: DON'T DO IT! And if you are using full
>> canonical pathnames clash is not possible anymore with ANY structure of
>> device names).
>>

Fb> Maybe I'm not seeing something here, but wouldn't it be better to just not
Fb> chomp the path at all? i.e.

Fb> /dev/tty1 -> /dev/tty1
Fb> /dev/vc/0 -> /dev/vc/0

Fb> and perhaps just compare the last characters of the names listed in
Fb> securetty, for compatibility..

May be it's best way but then you need modifications in TWO unrelated packages
(PAM modules and util-linux) and thus this way is MUCH more error-prone.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:12 EST