[patch] build fix for HURD

Marcus Brinkmann Marcus.Brinkmann at ruhr-uni-bochum.de
Fri Jul 13 20:49:25 UTC 2001


On Fri, Jul 13, 2001 at 06:46:19PM +0200, Martin Bialasinski wrote:
> On Fri, 13 Jul 2001, Pavel Roskin wrote:
> 
> > The patch is wrong.  PATH_MAX is not defined for a reason.  There is no
> > upper limit for the path length on GNU/Hurd. 
> 
> Yes. Therefore, you have to define it, when the Hurd doesn't set it, but
> MC uses the value, right?

Well, Pavel is correct.  Except I didn't bother to fix it properly, as I
understood it that gmc is not actively maintained anyway, and sort of being
phased out.

A proper patch which deals with arbitrary filenames is always preferred, I
was just being very lazy in this case.

> > Note that the buffer in
> > get_presorted_from() is allocated on the stack - exceeding it means crash
> > in the best case or an exploit if a malicious user prepares `.order' for
> > you.

Mmmmh.  The main stack of a task is unlimited, isn't it?  If you use
threading, on the Hurd each thread gets a fixed size thread, though.

If you want to be extra safe (I don't know about stacks on other systems),
you will have to use malloc/realloc and check the return value.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd at debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus at gnu.org
Marcus.Brinkmann at ruhr-uni-bochum.de
http://www.marcus-brinkmann.de




More information about the mc-devel mailing list