I just applied the attached patch to 4.3 as obvious.    It fixes
Savannah bug #20834.
Index: ChangeLog
===================================================================
RCS file: /sources/findutils/findutils/ChangeLog,v
retrieving revision 1.262
diff -u -p -r1.262 ChangeLog
--- ChangeLog	23 Aug 2007 02:34:45 -0000	1.262
+++ ChangeLog	23 Aug 2007 09:01:14 -0000
@@ -1,3 +1,9 @@
+2007-08-23  James Youngman  <[EMAIL PROTECTED]>
+
+	find/parser.c (check_path_safety): Assume the path is safe is
+	$PATH is not set.  This avoids a segfault in that situation
+	and thus fixes Savannmah bug #20834.
+
 2007-08-22  Eric Blake  <[EMAIL PROTECTED]>
 
 	Fix Savannah bug #20871.
Index: NEWS
===================================================================
RCS file: /sources/findutils/findutils/NEWS,v
retrieving revision 1.205
diff -u -p -r1.205 NEWS
--- NEWS	23 Aug 2007 02:34:45 -0000	1.205
+++ NEWS	23 Aug 2007 09:01:15 -0000
@@ -8,6 +8,9 @@ Public License.
 
 ** Bug Fixes
 
+#20834: Avoid segmentation violation for -execdir when $PATH is
+unset.  Assume that the PATH is safe in this situation.
+
 #20310: configure uses hosts's support status for "sort -z" when
 generating the updatedb script for use on the target.  This is
 inappropriate when cross-compiling, so avoid doing that.
Index: find/parser.c
===================================================================
RCS file: /sources/findutils/findutils/find/parser.c,v
retrieving revision 1.133
diff -u -p -r1.133 parser.c
--- find/parser.c	22 Aug 2007 21:53:58 -0000	1.133
+++ find/parser.c	23 Aug 2007 09:01:15 -0000
@@ -2888,8 +2888,17 @@ make_segment (struct segment **segment,
 static void 
 check_path_safety(const char *action, char **argv)
 {
-  const char *path = getenv("PATH");
   char *s;
+  const char *path = getenv("PATH");
+  if (NULL == path)
+    {
+      /* $PATH is not set.  Assume the OS default is safe.
+       * That may not be true on Windows, but I'm not aware 
+       * of a way to get Windows to avoid searching the 
+       * current directory anyway.
+       */
+      return;
+    }
 
   (void)argv;
   
_______________________________________________
Findutils-patches mailing list
Findutils-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/findutils-patches

Reply via email to