Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Strange coredump in new zsh-3.0.1 on Sunos4.1.3 (FIXED)

On Sat, 2 Nov 1996, Bart Schaefer wrote:

> zsh is picking an arbitrary value of 20 for the OPEN_MAX constant.  If
> zclose() is being called on fd=19, chances are that at some previous
> time the fdtable[] array was overflowed and trampled on max_zsh_fd.
> Chances are further that the reason for this is that `screen' is leaving
> way too many file descriptors open when it forks off children.  This is
> actually a potential security problem, because a program written to expect
> this behavior might obtain access to a pseudo-tty that it was not supposed
> to be able to access.
> I seem to recall patching at least one version of `screen' to close down
> file descriptors when forking children, but that was years ago; I very
> seldom use `screen' any more since it became gnuware (no, not *because*
> it did), and I quit hacking on it even before that.

OK, setting OPEN_MAX to 64 (and applying Zoltan's fix too)
did get rid of the bug. 

Thanks a lot !

BUT, it might be something totally different than I thought, NOT 'screen'
but 'ssh' (sshd), The secure-shell- programs from Tatu Ylonen
do open and pass on a filedescriptor to all their descendants.

This filedescriptor is 'constructed' by a test-program, and seems to
somehow get a definite number. And I saw this descriptor being the LAST
POSSIBLE Number (64!).

Our 'screen' is patched to NEVER close this descriptor (knowing it's
Number by an environment variable). Before this patch screen did close
nearly all descriptors (specially the needed one :-)

So zsh on screen on sshd might have died on that ...

For now your repair seems to have worked, and I wait for the users to
complain with now problems :-))

Thanks a lot,   sincerely your's     Stucki

Christoph von Stuckrad       * *  | talk to  | <stucki@xxxxxxxxxxxxxxxxx> \
Freie Universitaet Berlin    |/_* | nickname | ...!unido!fub!leibniz!stucki|
Fachbereich Mathematik, EDV  |\ * | 'stucki' | Tel:+49 30 838-7545{9|8}    |
Arnimallee 2-6/14195 Berlin  * *  |  on IRC  | Fax:+49 30 838-5913        /

Messages sorted by: Reverse Date, Date, Thread, Author