On 6 Jan 2000, Niels M�ller wrote:
> "Eric J. Schwertfeger" <[EMAIL PROTECTED]> writes:
>
> > When I edited config.h to fix PTY_BSD_SCHEME_FIRST_CHARS and
> > PTY_BSD_SCHEME_SECOND_CHARS by hand, it worked. So the previously
> > mentioned problems are all that have to be overcome before FreeBSD has an
> > unencumbered encrypted login method :-)
>
> What values did configure assign to these defines, and what did you
> change it to? I'd like to know why the configure test failed.
Due to what appears to be a bug in /bin/sh which was reportedly fixed
about a month ago, both defines were getting an empty string for their
value. Balazs posted a fix yesterday, which was to run the expansion,
assigning the results to a variable, and then use just the variable within
the redirect.
>
> > I'll look into POLLIN vs POLLRDNORM.
>
> Please do.
No response from the FreeBSD list on that yet. Balazs suggested using
POLLIN|POLLRDNORM. Anyone here have anything remotely resembling online
POSIX specs covering poll()? By my interpretation of the man page, POLLIN
should work unless reading from a disk-based file is considered high
priority, but I can't find anything saying what is supposed to be high
priority.
> It would make sense to prefer openpty() over the PTY_BSD_SCHEME stuff.
> It's some time since I touched the pty allocation, but the requirements
> are a little different from most other applications. Because the
> server needs to tell the client whether or not pty allocation
> succeeded, the pty must be opened long before the server forks and
> changes uid. So if openpty uses the process's current uid to set up
> permissions and stuff, it will likely get them wrong.
>
> Sorry I don't remember all the details; perhaps openpty is just right.
No, given your description and the man page, I do think that openpty() by
itself would get the permissions wrong. However, openpty() will put the
name of the slave pty into a buffer if set up to do so, so you could
change the permissions after the openpty but before the fork. Not a high
priority, though, since the PTY_BSD_SCHEME problem has been resolved. I
will test this myself this weekend and report back here if I get the
chance.