summaryrefslogtreecommitdiff
path: root/recipes/mozilla/nss-3.12.6/90_realpath.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2010-04-16 14:44:11 +0200
committerKoen Kooi <koen@openembedded.org>2010-04-16 14:44:11 +0200
commitc35a432051fe5e4f42c8b35845af5eddf00ddeb3 (patch)
tree300f4fa9c29433668d92759873117f9954412286 /recipes/mozilla/nss-3.12.6/90_realpath.patch
parent17e346ad3489908895177caf63c620eeff6d9a97 (diff)
nss: update to 3.12.6
Diffstat (limited to 'recipes/mozilla/nss-3.12.6/90_realpath.patch')
-rw-r--r--recipes/mozilla/nss-3.12.6/90_realpath.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/recipes/mozilla/nss-3.12.6/90_realpath.patch b/recipes/mozilla/nss-3.12.6/90_realpath.patch
new file mode 100644
index 0000000000..eb4147a36f
--- /dev/null
+++ b/recipes/mozilla/nss-3.12.6/90_realpath.patch
@@ -0,0 +1,35 @@
+## 90_realpath.patch by Mike Hommey <glandium@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Use realpath() for loader_GetOriginalPathname, so that symlinks are
+## DP: properly followed when determining where the current library lives.
+
+diff --git a/mozilla/security/nss/lib/freebl/genload.c b/mozilla/security/nss/lib/freebl/genload.c
+index fac6e22..d242517 100644
+--- a/mozilla/security/nss/lib/freebl/genload.c
++++ b/mozilla/security/nss/lib/freebl/genload.c
+@@ -62,6 +62,16 @@
+ */
+ static char* loader_GetOriginalPathname(const char* link)
+ {
++#ifdef __GLIBC__
++ char* tmp = realpath(link, NULL);
++ char* resolved;
++ if (! tmp)
++ return NULL;
++ resolved = PR_Malloc(strlen(tmp) + 1);
++ strcpy(resolved, tmp); /* This is necessary because PR_Free might not be using free() */
++ free(tmp);
++ return resolved;
++#else
+ char* resolved = NULL;
+ char* input = NULL;
+ PRUint32 iterations = 0;
+@@ -96,6 +106,7 @@ static char* loader_GetOriginalPathname(const char* link)
+ input = NULL;
+ }
+ return input;
++#endif
+ }
+ #endif /* XP_UNIX */
+