gpm 1.19.4 - SEGV in Gpm_Open()

Nico Schottelius nicos@pcsystems.de
Tue, 18 Sep 2001 19:51:02 +0200


Hello Jakub!

> [BTW, are gpm@prosa.it and gpm@lists.linux.it separate lists or one is
> an alias to the other?

use @lists.linux.it. prosa is old.

> On Sat, Sep 08, 2001 at 10:39:24PM +0200, Nico Schottelius wrote:
> > You are right!
> > This is fixed in the next gpm version.
> > I will release 1.19.5 in about one week.
> >
> > check_devfs was a small hack.
>
> Oh, sorry, but my fix wasn't complete.
>
> I just copied check_devfs() from gpm.c; but it can't be used in
> Gpm_Open() that way - because some program linked with libgpm (mc,
> links) can be run by user without privileges to open tty0 (e.g. from
> xterm or through telnet/ssh, or if one than more users are logged on
> console).

You are right. But everyone can stat the console.
So the devfs code changed and the liblow code keeps the same .

> AFAIK in case of xterm/non local terminal Gpm_Open()

non-localt terminal ? Do you want to use gpm via ssh ?

> should fail (return error status), but not call oops() which exits whole
> program
> (leaving terminal in wrong state)...

It now oops, if not /dev/tty0 and /dev/vc/0 do not exist. If that's
the case we are on a non Linux system.

> I attach new version of patch, where these problems are fixed.
> I've just changed open() to stat() - it may be not the best method
> (also, I haven't tested it with devfs because I don't use devfs).

That's the solution.

It's fine in gpm1.19.5...

Nico