[xml-security-c] 05/24: Delete upstreamed patch "Avoid use of PATH_MAX where possible"

Ferenc Wágner wferi-guest at moszumanska.debian.org
Sun Nov 29 19:42:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

wferi-guest pushed a commit to branch master
in repository xml-security-c.

commit f8b635d63fc2cf03997c31c0e1f6fca74bc401d6
Author: Ferenc Wágner <wferi at niif.hu>
Date:   Tue Nov 24 14:27:32 2015 +0100

    Delete upstreamed patch "Avoid use of PATH_MAX where possible"
    
    https://issues.apache.org/jira/browse/SANTUARIO-380
---
 .../0001-Add-xsec-prefix-to-utilities.patch        |   4 +-
 ...0002-Avoid-use-of-PATH_MAX-where-possible.patch | 211 ---------------------
 debian/patches/series                              |   1 -
 3 files changed, 2 insertions(+), 214 deletions(-)

diff --git a/debian/patches/0001-Add-xsec-prefix-to-utilities.patch b/debian/patches/0001-Add-xsec-prefix-to-utilities.patch
index 7c09f79..851b9b0 100644
--- a/debian/patches/0001-Add-xsec-prefix-to-utilities.patch
+++ b/debian/patches/0001-Add-xsec-prefix-to-utilities.patch
@@ -7,11 +7,11 @@ generic names.  Add xsec- to the beginning of all of the binary
 names to avoid colliding with other packages or claiming too
 generic of a namespace.
 ---
- xsec/Makefile.am | 32 ++++++++++++++++----------------
+ xsec/Makefile.am |   32 ++++++++++++++++----------------
  1 file changed, 16 insertions(+), 16 deletions(-)
 
 diff --git a/xsec/Makefile.am b/xsec/Makefile.am
-index 7c48495..850ce94 100644
+index c4f41a6..f1c484c 100644
 --- a/xsec/Makefile.am
 +++ b/xsec/Makefile.am
 @@ -69,42 +69,42 @@ tools =
diff --git a/debian/patches/0002-Avoid-use-of-PATH_MAX-where-possible.patch b/debian/patches/0002-Avoid-use-of-PATH_MAX-where-possible.patch
deleted file mode 100644
index 8bfedd3..0000000
--- a/debian/patches/0002-Avoid-use-of-PATH_MAX-where-possible.patch
+++ /dev/null
@@ -1,211 +0,0 @@
-From: Svante Signell <svante.signell at gmail.com>
-Date: Mon, 7 Apr 2014 16:53:28 -0700
-Subject: Avoid use of PATH_MAX where possible
-
-xml-security-c currently FTBFS on GNU/Hurd due to PATH_MAX issues.
-
-The attached patch fixes this problem by adding a check in
-configure.ac for a working path = getcwd(NULL, 0), allocating
-the string length required dynamically, and freeing it later on.
-Similarly, the string baseURI is malloced and freed. As a fallback,
-when this is not supported, the code uses the old solution that
-assumes PATH_MAX is defined.
----
- configure.ac                             | 11 +++++++++++
- xsec/tools/checksig/checksig.cpp         | 17 ++++++++++++-----
- xsec/tools/cipher/cipher.cpp             | 17 ++++++++++++-----
- xsec/tools/templatesign/templatesign.cpp | 17 ++++++++++++-----
- xsec/tools/txfmout/txfmout.cpp           | 18 ++++++++++++------
- 5 files changed, 59 insertions(+), 21 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 09e478e..8c7f9c3 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -73,6 +73,17 @@ AC_CHECK_HEADERS(unistd.h direct.h)
- 
- AC_CHECK_DECL(strcasecmp,[AC_DEFINE([XSEC_HAVE_STRCASECMP],[1],[Define to 1 if strcasecmp present.])],,[#include <string.h>]) 
- 
-+# Check whether getcwd can dynamically allocate memory.
-+AC_MSG_CHECKING([whether getcwd(NULL, 0) works])
-+AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdlib.h>
-+     #include <unistd.h>],
-+[char *cwd = getcwd(NULL, 0);
-+return (cwd != NULL) ? EXIT_SUCCESS : EXIT_FAILURE;])],
-+     [AC_MSG_RESULT(yes)
-+      AC_DEFINE([HAVE_GETCWD_DYN], [1],
-+         [Define to 1 if getcwd(NULL, 0) works])],
-+     [AC_MSG_RESULT(no)])
-+
- AC_LANG(C++)
- 
- # Xerces is required
-diff --git a/xsec/tools/checksig/checksig.cpp b/xsec/tools/checksig/checksig.cpp
-index db81d27..fc4ac41 100644
---- a/xsec/tools/checksig/checksig.cpp
-+++ b/xsec/tools/checksig/checksig.cpp
-@@ -57,7 +57,6 @@
- 
- #if defined(HAVE_UNISTD_H)
- # include <unistd.h>
--# define _MAX_PATH PATH_MAX
- #else
- # if defined(HAVE_DIRECT_H)
- #  include <direct.h>
-@@ -438,10 +437,14 @@ int evaluate(int argc, char ** argv) {
- 		AnonymousResolver theAnonymousResolver;
- 		     
- 		// Map out base path of the file
--		char path[_MAX_PATH];
--		char baseURI[(_MAX_PATH * 2) + 10];
--		getcwd(path, _MAX_PATH);
--
-+#if HAVE_GETCWD_DYN
-+		char *path = getcwd(NULL, 0);
-+		char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1);
-+#else
-+		char path[PATH_MAX];
-+		char baseURI[(PATH_MAX * 2) + 10];
-+		getcwd(path, PATH_MAX);
-+#endif
- 		strcpy(baseURI, "file:///");		
- 
- 		// Ugly and nasty but quick
-@@ -471,6 +474,10 @@ int evaluate(int argc, char ** argv) {
- 		XMLCh * baseURIXMLCh = XMLString::transcode(baseURI);
- 
- 		XMLUri uri(MAKE_UNICODE_STRING(baseURI));
-+#if HAVE_GETCWD_DYN
-+		free(path);
-+		free(baseURI);
-+#endif
- 
- 		if (useAnonymousResolver == true) {
- 			// AnonymousResolver takes precedence
-diff --git a/xsec/tools/cipher/cipher.cpp b/xsec/tools/cipher/cipher.cpp
-index ec10a2a..d081c98 100644
---- a/xsec/tools/cipher/cipher.cpp
-+++ b/xsec/tools/cipher/cipher.cpp
-@@ -60,7 +60,6 @@
- 
- #if defined(HAVE_UNISTD_H)
- # include <unistd.h>
--# define _MAX_PATH PATH_MAX
- #else
- # if defined(HAVE_DIRECT_H)
- #  include <direct.h>
-@@ -639,10 +638,14 @@ int evaluate(int argc, char ** argv) {
- 			if (useInteropResolver == true) {
- 
- 				// Map out base path of the file
--				char path[_MAX_PATH];
--				char baseURI[(_MAX_PATH * 2) + 10];
--				getcwd(path, _MAX_PATH);
--
-+#if HAVE_GETCWD_DYN
-+				char *path = getcwd(NULL, 0);
-+				char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1);
-+#else
-+				char path[PATH_MAX];
-+				char baseURI[(PATH_MAX * 2) + 10];
-+				getcwd(path, PATH_MAX);
-+#endif
- 				strcpy(baseURI, "file:///");		
- 
- 				// Ugly and nasty but quick
-@@ -671,6 +674,10 @@ int evaluate(int argc, char ** argv) {
- 				baseURI[lastSlash + 1] = '\0';
- 
- 				XMLCh * uriT = XMLString::transcode(baseURI);
-+#if HAVE_GETCWD_DYN
-+				free(path);
-+				free(baseURI);
-+#endif
- 
- 				XencInteropResolver ires(doc, &(uriT[8]));
- 				XSEC_RELEASE_XMLCH(uriT);
-diff --git a/xsec/tools/templatesign/templatesign.cpp b/xsec/tools/templatesign/templatesign.cpp
-index ef56b8b..953fdcb 100644
---- a/xsec/tools/templatesign/templatesign.cpp
-+++ b/xsec/tools/templatesign/templatesign.cpp
-@@ -74,7 +74,6 @@
- 
- #if defined(HAVE_UNISTD_H)
- # include <unistd.h>
--# define _MAX_PATH PATH_MAX
- #else
- # if defined(HAVE_DIRECT_H)
- #  include <direct.h>
-@@ -1169,10 +1168,14 @@ int main(int argc, char **argv) {
-      
- 	// Map out base path of the file
- 	char * filename=argv[argc-1];
--	char path[_MAX_PATH];
--	char baseURI[(_MAX_PATH * 2) + 10];
--	getcwd(path, _MAX_PATH);
--
-+#if HAVE_GETCWD_DYN
-+	char *path = getcwd(NULL, 0);
-+	char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1);
-+#else
-+	char path[PATH_MAX];
-+	char baseURI[(PATH_MAX * 2) + 10];
-+	getcwd(path, PATH_MAX);
-+#endif
- 	strcpy(baseURI, "file:///");		
- 
- 	// Ugly and nasty but quick
-@@ -1202,6 +1205,10 @@ int main(int argc, char **argv) {
- 
- 	theResolver->setBaseURI(MAKE_UNICODE_STRING(baseURI));
- 	sig->setURIResolver(theResolver);
-+#if HAVE_GETCWD_DYN
-+	free(path);
-+	free(baseURI);
-+#endif
- 
- 	try {
- 		sig->load();
-diff --git a/xsec/tools/txfmout/txfmout.cpp b/xsec/tools/txfmout/txfmout.cpp
-index b91a164..86eeb37 100644
---- a/xsec/tools/txfmout/txfmout.cpp
-+++ b/xsec/tools/txfmout/txfmout.cpp
-@@ -57,7 +57,6 @@
- 
- #if defined(HAVE_UNISTD_H)
- # include <unistd.h>
--# define _MAX_PATH PATH_MAX
- #else
- # if defined(HAVE_DIRECT_H)
- #  include <direct.h>
-@@ -502,10 +501,14 @@ int main(int argc, char **argv) {
- 		theResolver;
- 		 
- 	// Map out base path of the file
--	char path[_MAX_PATH];
--	char baseURI[(_MAX_PATH * 2) + 10];
--	getcwd(path, _MAX_PATH);
--
-+#if HAVE_GETCWD_DYN
-+	char *path = getcwd(NULL, 0);
-+	char *baseURI = (char*)malloc(strlen(path) + 8 + 1 + strlen(filename) + 1);
-+#else
-+	char path[PATH_MAX];
-+	char baseURI[(PATH_MAX * 2) + 10];
-+	getcwd(path, PATH_MAX);
-+#endif
- 	strcpy(baseURI, "file:///");
- 	strcat(baseURI, path);
- 	strcat(baseURI, "/");
-@@ -526,7 +529,10 @@ int main(int argc, char **argv) {
- 	baseURI[lastSlash + 1] = '\0';
- 
- 	theResolver.setBaseURI(MAKE_UNICODE_STRING(baseURI));
--
-+#if HAVE_GETCWD_DYN
-+	free(path);
-+	free(baseURI);
-+#endif
- 	sig->setURIResolver(&theResolver);
- 
- 
diff --git a/debian/patches/series b/debian/patches/series
index 1b1bcea..819815e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 0001-Add-xsec-prefix-to-utilities.patch
-0002-Avoid-use-of-PATH_MAX-where-possible.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/xml-security-c.git



More information about the Pkg-shibboleth-devel mailing list