Date: Sun, 23 Jul 2000 00:36:09 -0400 (EDT) From: Trevor Johnson <trevor@jpj.net> To: The Hermit Hacker <scrappy@hub.org> Cc: kde-devel@max.tat.physik.uni-tuebingen.de, freebsd-ports@FreeBSD.ORG, Ronald Kuehn <kuehn@rz.tu-clausthal.de> Subject: Re: KDE2 and konsole_grantpty (Was: Re: More on Session hangs ... ) Message-ID: <Pine.BSI.4.21.0007222323360.25361-100000@blues.jpj.net> In-Reply-To: <Pine.BSF.4.21.0007222104580.325-100000@thelab.hub.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> okay, this might make sense to someone out there ... looking at > konsole_grantpty, the fod that is failing appears to be: > > pty = ttyname(PTY_FILENO); /* posix */ > if (pty == NULL) > { > fprintf(stderr,"%s: cannot determine the name of device.\n",argv[0]); > return 1; /* FAIL */ > } > close(PTY_FILENO); > > where PTY_FILENO is hardcoded as 3: > > #define PTY_FILENO 3 /* keep in sync with grantpty */ > > What does the 3 signify? Is this something specific to Linux that needs > to be set to a different value for *BSD (and, apparently, UnixWare7)? I searched the Web for "PTY_FILENO" and found http://www.draper.net/glibc-2.1/S/login%20programs%20pt_chown.c.html . It's a daemon that comes with the GNU C library that seems to do the same thing that konsole_grantpty is for. PTY_FILENO is defined in the accompanying pty-private.h (http://www.draper.net/glibc-2.1/S/login%20pty-private.h.html) which says: 27 /* The file descriptor connected to the master pseudo terminal. */ 28 #define PTY_FILENO 3 At http://www.securiteam.com/unixfocus/Emacs_found_to_contain_several_security_vulnerabilities__eavesdrop__tmp__password_.html I read: For FreeBSD, an enhancement to openpty() has been proposed which sets proper permissions on the slave TTY device (see problem report bin/9770). The proposal has yet to be adopted, though. I added Ronald Kuehn, who submitted the PR, to the CC line. I only took a cursory look at his program, but it seems to serve a similar function to konsole_grantpty or pt_chown, except that he wrote it especially for FreeBSD. I guess most of the Linux folks can use UNIX 98 ptys (http://www.unix-systems.org/single_unix_specification_v2/xsh/grantpt.html) now, and don't need such daemons. -- Trevor Johnson http://jpj.net/~trevor/gpgkey.txt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.4.21.0007222323360.25361-100000>