findutils segfault patch

Richard Lightman richard at nezumi.plus.com
Fri Oct 25 01:25:45 PDT 2002


* Anderson Lizardo <lizardo at horizon.com.br> [2002-10-25 08:52]:
> It's really necessary to apply this patch? I made (for test purposes) a
> long dir with 8400 slashes, but I didn't see a segfault error... It's
> something related to memory?
> 
>From the book:
Command explanations

   patch -Np1 -i ../findutils-4.1.patch: This patch is to fix some
   compilation errors by avoiding a variable conflict and changing
   some bad syntax.

I just tried to compile this without the patch, and got plenty of
errors with glibc version 2.2.5, gcc version 3.2. You could try reading
the patch:

In findutils-4.1/find/defs.h:
-char *basename P_((char *fname));
+char *basename2 P_((char *fname));
[...]
-char *strdup ();
-char *strstr ();

These are defined in string.h, so defining them here (wrongly) is
naughty. Older versions of the compiler might not complain if you
pick the right CFLAGS.

In findutils-4.1/find/parser.c:
-char *strstr ();

as above.


In findutils-4.1/find/pred.c:
+#define _GNU_SOURCE

This makes some non-standard parts of glibc available. I assume that
they are used later. If you do not ask for extras, modern versions
of glibc will not provide them to avoid poluting the name space.


In findutils-4.1/find/util.c:
-basename (fname)
+basename2 (fname)

In findutils-4.1/lib/nextelem.c:
-char *strdup ();

In findutils-4.1/xargs/xargs.c:
-char *strstr ();
-char *strdup ();

Nothing new there. Looks like the patch does exactly what the book
says it does.

Richard
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list