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

Waldo Bastian bastian at kde.org
Mon Sep 2 01:14:51 UTC 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 01 September 2002 05:40 pm, Michael Samuel wrote:
> >> 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 */
>   }

Good idea. My compiler explains to me that I have revoke() but that it isn't 
implemented :-]

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

*yay*

Cheers,
Waldo
- -- 
bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9cruPN4pvrENfboIRAqGeAJ94JhZtZrR8Rjxmq2jJRrVpeQ1uOwCfYsO3
h6pi2zga7z3rT0UTpfSovpk=
=Ez+o
-----END PGP SIGNATURE-----




More information about the konsole-devel mailing list