[107951] trunk/dports/shells/bash

raimue at macports.org raimue at macports.org
Tue Jul 9 14:26:25 PDT 2013


Revision: 107951
          https://trac.macports.org/changeset/107951
Author:   raimue at macports.org
Date:     2013-07-09 14:26:25 -0700 (Tue, 09 Jul 2013)
Log Message:
-----------
shells/bash:
Patch a runtime error involving overlapping buffers being passed to strcpy().
Some libc implementation on some version of OS X does not seem to like this
anymore.

Upstream-Report: http://article.gmane.org/gmane.comp.shells.bash.bugs/20242

Modified Paths:
--------------
    trunk/dports/shells/bash/Portfile

Added Paths:
-----------
    trunk/dports/shells/bash/files/
    trunk/dports/shells/bash/files/patch-strcpy-overlap.diff

Modified: trunk/dports/shells/bash/Portfile
===================================================================
--- trunk/dports/shells/bash/Portfile	2013-07-09 20:57:45 UTC (rev 107950)
+++ trunk/dports/shells/bash/Portfile	2013-07-09 21:26:25 UTC (rev 107951)
@@ -6,6 +6,7 @@
 set bash_version    4.2
 set bash_patchlevel 45
 version             ${bash_version}.${bash_patchlevel}
+revision            1
 distname            ${name}-${bash_version}
 categories          shells
 platforms           darwin freebsd
@@ -34,6 +35,9 @@
         [format "%s%s-%03d" $name [strsed ${bash_version} {g/\.//}] $i]
 }
 
+# Local patchfiles
+patchfiles-append   patch-strcpy-overlap.diff
+
 checksums-append \
     bash42-001 sha1 c069f07492c9199bc7cff71a4f032f668ba4ea0a \
     bash42-002 sha1 75b6726656a08e47172704545c57a290e29075e9 \

Added: trunk/dports/shells/bash/files/patch-strcpy-overlap.diff
===================================================================
--- trunk/dports/shells/bash/files/patch-strcpy-overlap.diff	                        (rev 0)
+++ trunk/dports/shells/bash/files/patch-strcpy-overlap.diff	2013-07-09 21:26:25 UTC (rev 107951)
@@ -0,0 +1,22 @@
+The buffers passed as source and destination to strcpy() must not overlap.
+There are libc implementations that are enforcing this by calling abort() on
+misbehaving calls.
+--- parse.y
++++ parse.y
+@@ -5273,9 +5273,13 @@ decode_prompt_string (string)
+ #undef ROOT_PATH
+ #undef DOUBLE_SLASH_ROOT
+ 		else
+-		  /* polite_directory_format is guaranteed to return a string
+-		     no longer than PATH_MAX - 1 characters. */
+-		  strcpy (t_string, polite_directory_format (t_string));
++		  {
++		    /* polite_directory_format is guaranteed to return a string
++		       no longer than PATH_MAX - 1 characters. */
++		    temp = polite_directory_format (t_string);
++		    if (temp != t_string)
++		      strcpy (t_string, temp);
++		  }
+ 
+ 		temp = trim_pathname (t_string, PATH_MAX - 1);
+ 		/* If we're going to be expanding the prompt string later,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130709/3916cee2/attachment.html>


More information about the macports-changes mailing list