summaryrefslogtreecommitdiffstats
path: root/debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:23:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:23:08 +0000
commit25161eab0977cf62f77af868be3fc698888776ea (patch)
treeea9037f8066dfc7c0a7d7b898822a56fec71c324 /debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch
parentAdding upstream version 110.0.1. (diff)
downloadfirefox-debian.tar.xz
firefox-debian.zip
Adding debian version 110.0.1-1.debian/110.0.1-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch')
-rw-r--r--debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch b/debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch
new file mode 100644
index 0000000000..224d460660
--- /dev/null
+++ b/debian/patches/porting/NSS-Fix-FTBFS-on-Hurd-because-of-MAXPATHLEN.patch
@@ -0,0 +1,63 @@
+From: Mike Hommey <mh@glandium.org>
+Date: Mon, 13 Jan 2014 12:00:25 +0900
+Subject: [NSS] Fix FTBFS on Hurd because of MAXPATHLEN
+
+---
+ security/nss/cmd/shlibsign/shlibsign.c | 21 ++++++++++++++++-----
+ security/nss/lib/freebl/unix_rand.c | 4 ++++
+ 2 files changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/security/nss/cmd/shlibsign/shlibsign.c b/security/nss/cmd/shlibsign/shlibsign.c
+index ad8f3b8..c33f2c9 100644
+--- a/security/nss/cmd/shlibsign/shlibsign.c
++++ b/security/nss/cmd/shlibsign/shlibsign.c
+@@ -725,7 +725,6 @@ main(int argc, char **argv)
+ #ifdef USES_LINKS
+ int ret;
+ struct stat stat_buf;
+- char link_buf[MAXPATHLEN + 1];
+ char *link_file = NULL;
+ #endif
+
+@@ -1068,10 +1067,22 @@ main(int argc, char **argv)
+ }
+ if (S_ISLNK(stat_buf.st_mode)) {
+ char *dirpath, *dirend;
+- ret = readlink(input_file, link_buf, sizeof(link_buf) - 1);
+- if (ret < 0) {
+- perror(input_file);
+- goto cleanup;
++ char *link_buf = NULL;
++ size_t size = 64;
++ while (1) {
++ link_buf = realloc(link_buf, size);
++ if (!link_buf) {
++ perror(input_file);
++ goto cleanup;
++ }
++ ret = readlink(input_file, link_buf, size - 1);
++ if (ret < 0) {
++ perror(input_file);
++ goto cleanup;
++ }
++ if (ret < size - 1)
++ break;
++ size *= 2;
+ }
+ link_buf[ret] = 0;
+ link_file = mkoutput(input_file);
+diff --git a/security/nss/lib/freebl/unix_rand.c b/security/nss/lib/freebl/unix_rand.c
+index e46bac6..9ca2ba4a 100644
+--- a/security/nss/lib/freebl/unix_rand.c
++++ b/security/nss/lib/freebl/unix_rand.c
+@@ -756,6 +756,10 @@ RNG_FileForRNG(const char *fileName)
+ #define _POSIX_PTHREAD_SEMANTICS
+ #include <dirent.h>
+
++#ifndef PATH_MAX
++#define PATH_MAX 1024
++#endif
++
+ PRBool
+ ReadFileOK(char *dir, char *file)
+ {