Bug#42986: [Konsole-devel] Bug#42986: dup2() in freebsd

Michael Samuel michael at miknet.net
Mon Sep 2 00:40:56 UTC 2002


>> Of course, that doesn't fix the race condition still present on all
>> systems. (what happens if somebody opens the tty device before we do
>> the
>> chown, but after we open the pty master?)

>I have no idea how any of this is supposed to work.

Well, in konsole_grantpty.c, after the chown and chmod, you simply do
a revoke, then all's OK. (There's no man page for revoke in Debian,
but it's in unistd.h, and FreeBSD has a man page entry)

So, right before the "return 0;", add this code block in:

  if (revoke(tty) < 0)
  {
    fprintf(stderr,"%s: cannot revoke %s.\n",argv[0],tty); perror("Reason");
    return 1; /* FAIL */
  }

Once you've done that, you can just release a security advisory, and
all's OK :)

-- 
Michael Samuel <michael at miknet.net>

(Complete bug history is available at http://bugs.kde.org/db/42/42986.html)



More information about the konsole-devel mailing list