Your message dated Tue, 08 Apr 2014 00:34:33 +0000
with message-id <[email protected]>
and subject line Bug#735162: fixed in xml-security-c 1.7.2-3
has caused the Debian Bug report #735162,
regarding xml-security-c: FTBFS on hurd-i386
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
735162: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735162
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: xml-security-c
Version: 1.7.2-2
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
xml-security-c currently FTBFS on GNU/Hurd due to PATH_MAX issues, see
https://buildd.debian.org/status/fetch.php?pkg=xml-security-c&arch=hurd-i386&ver=1.7.2-2&stamp=1389227253
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 freed later on. Similarly the string baseURI
is malloced and freed. As a fallback, when this is not supported, the
code falls back to the old solution using PATH_MAX, assuming it is
defined.
Thanks!
--- 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 for required functionality
+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
--- 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,9 @@ int evaluate(int argc, char ** argv) {
XMLCh * baseURIXMLCh = XMLString::transcode(baseURI);
XMLUri uri(MAKE_UNICODE_STRING(baseURI));
+#if HAVE_GETCWD_DYN
+ free(baseURI);
+#endif
if (useAnonymousResolver == true) {
// AnonymousResolver takes precedence
--- 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,9 @@ int evaluate(int argc, char ** argv) {
baseURI[lastSlash + 1] = '\0';
XMLCh * uriT = XMLString::transcode(baseURI);
+#if HAVE_GETCWD_DYN
+ free(baseURI);
+#endif
XencInteropResolver ires(doc, &(uriT[8]));
XSEC_RELEASE_XMLCH(uriT);
--- 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,9 @@ int main(int argc, char **argv) {
theResolver->setBaseURI(MAKE_UNICODE_STRING(baseURI));
sig->setURIResolver(theResolver);
+#if HAVE_GETCWD_DYN
+ free(baseURI);
+#endif
try {
sig->load();
--- 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,9 @@ int main(int argc, char **argv) {
baseURI[lastSlash + 1] = '\0';
theResolver.setBaseURI(MAKE_UNICODE_STRING(baseURI));
-
+#if HAVE_GETCWD_DYN
+ free(baseURI);
+#endif
sig->setURIResolver(&theResolver);
--- End Message ---
--- Begin Message ---
Source: xml-security-c
Source-Version: 1.7.2-3
We believe that the bug you reported is fixed in the latest version of
xml-security-c, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Russ Allbery <[email protected]> (supplier of updated xml-security-c package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Mon, 07 Apr 2014 17:10:56 -0700
Source: xml-security-c
Binary: libxml-security-c17 libxml-security-c-dev xml-security-c-utils
Architecture: source i386
Version: 1.7.2-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Shib Team <[email protected]>
Changed-By: Russ Allbery <[email protected]>
Description:
libxml-security-c-dev - C++ library for XML Digital Signatures (development)
libxml-security-c17 - C++ library for XML Digital Signatures (runtime)
xml-security-c-utils - C++ library for XML Digital Signatures (utilities)
Closes: 735162
Changes:
xml-security-c (1.7.2-3) unstable; urgency=medium
.
* Avoid use of PATH_MAX where possible by using getcwd to allocate the
appropriate size string. Fixes FTBFS on GNU/Hurd. Patch from Svante
Signell. (Closes: #735162)
* Convert all Debian patches to separate patch files managed via gbp pq.
* Update standards version to 3.9.5 (no changes required).
Checksums-Sha1:
1c33178bff3d9f3f65737e5bea468a12158a7f32 1824 xml-security-c_1.7.2-3.dsc
612635855e264f880ff28264820d1841690b6242 13720
xml-security-c_1.7.2-3.debian.tar.xz
478bf611280e39f7ac859dc103067bdf0f2774e0 279012
libxml-security-c17_1.7.2-3_i386.deb
9daabef378b1d52a2d1385fb19c160fcd9d4f734 111396
libxml-security-c-dev_1.7.2-3_i386.deb
7f79c44fdc1498c78f023951028b07da71fda48a 121554
xml-security-c-utils_1.7.2-3_i386.deb
Checksums-Sha256:
c192287ad93ef132e73b478aa276d452d20f8fea2aa87865f66e4f21cfc0260e 1824
xml-security-c_1.7.2-3.dsc
aa74d32cf9b89719a643e0fc0d31990a077412a5b3e9b77f3ad12a585520f34f 13720
xml-security-c_1.7.2-3.debian.tar.xz
4562f1d1dab009ebc57cfe91f71f5ad60a1e03bb29dcdf3c339d2678f0a4d421 279012
libxml-security-c17_1.7.2-3_i386.deb
83e4151ce51e767ffb9dbcab3b9735f83a02de3a36e0c09a89c5b576604b84c4 111396
libxml-security-c-dev_1.7.2-3_i386.deb
9d62882790b80c0160088585fb38620e3a60412fad42ea1f500915c66a67c42e 121554
xml-security-c-utils_1.7.2-3_i386.deb
Files:
37d2870f31c1950881d8a92e074fe193 1824 libs extra xml-security-c_1.7.2-3.dsc
6f3868e47903f0017549a62e9a962dff 13720 libs extra
xml-security-c_1.7.2-3.debian.tar.xz
50da1eef0c540b518b8e9dce8af3f85d 279012 libs extra
libxml-security-c17_1.7.2-3_i386.deb
20606509c0b75ffbca84e9aec106cfdd 111396 libdevel extra
libxml-security-c-dev_1.7.2-3_i386.deb
bdae46c7629f5cc78d94adbdc778ccc2 121554 utils extra
xml-security-c-utils_1.7.2-3_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBCAAGBQJTQ0KQAAoJEH2AMVxXNt51T88IALsdjAwqMIOR8cPDlS2KUYGu
nDkzZJVUdlAKannvQ4Vq6wRq+DcWfcbf/46uJ/xTrIja5I3NitwZDWAojQKA05e9
Vm9bRwULUFIUNjzAjpAPqLv0NBkeZCBUs5P324lYWJti3LcbVnGKLrPR6suG6s77
xFRDjChqtm34VY4HSbmABPQJCtljej4ppXEdDvTWx4dBJ5SmE8RAdaGvFGuCZI1D
2Bn1wm5FthvssJRRQfmU/jbL2PL1uYV/UHAP+/5VftRHA77YDnUbN/p3dSj6rtNR
JHmbQ11Zdsx31we748cop5WRq8a68xyG6pTcIVX5KUraKz18+NcpiqqDvcLkS6I=
=6Kmu
-----END PGP SIGNATURE-----
--- End Message ---