diff -u mono-1.9.1+dfsg/debian/changelog mono-1.9.1+dfsg/debian/changelog --- mono-1.9.1+dfsg/debian/changelog +++ mono-1.9.1+dfsg/debian/changelog @@ -1,3 +1,10 @@ +mono (1.9.1+dfsg-2ubuntu2) intrepid; urgency=low + + * Replaced don't_check_proc_self_exe with something a little less + braindead. New patch is check_prefix_on_proc_self_exe. + + -- Michael Casadevall Wed, 16 Jul 2008 21:16:23 +0000 + mono (1.9.1+dfsg-2ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: reverted: --- mono-1.9.1+dfsg/debian/patches/dont_check_proc_self_exe.dpatch +++ mono-1.9.1+dfsg.orig/debian/patches/dont_check_proc_self_exe.dpatch @@ -1,24 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run - -@DPATCH@ - -diff -pruN 1.1.17.1-1/mono/metadata/assembly.c 1.1.17.1-1ubuntu7/mono/metadata/assembly.c ---- 1.1.17.1-1/mono/metadata/assembly.c 2006-08-25 20:35:15.000000000 +0100 -+++ 1.1.17.1-1ubuntu7/mono/metadata/assembly.c 2006-10-27 10:42:26.000000000 +0100 -@@ -582,6 +582,7 @@ mono_set_rootdir (void) - g_free (bindir); - g_free (utf8name); - #else -+#if 0 - char buf [4096]; - int s; - char *str; -@@ -604,6 +605,7 @@ mono_set_rootdir (void) - set_dirs (buf); - return; - } -+#endif - fallback (); - #endif - } - diff -u mono-1.9.1+dfsg/debian/patches/00list mono-1.9.1+dfsg/debian/patches/00list --- mono-1.9.1+dfsg/debian/patches/00list +++ mono-1.9.1+dfsg/debian/patches/00list @@ -16,2 +16,2 @@ -dont_check_proc_self_exe remove_arg_max_check_r101444 +check_prefix_on_proc_self_exe only in patch2: unchanged: --- mono-1.9.1+dfsg.orig/debian/patches/check_prefix_on_proc_self_exe.dpatch +++ mono-1.9.1+dfsg/debian/patches/check_prefix_on_proc_self_exe.dpatch @@ -0,0 +1,39 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## dont_check_proc_self_exe.dpatch by Michael Casadevall +## +## DP: Causes any check to /proc/self/exe to check prefixes, and see if +## it requires autocorrection when on unionfs filesystems (aka livecd) + +@DPATCH@ +diff -urNad mono-1.9.1+dfsg~/mono/metadata/assembly.c mono-1.9.1+dfsg/mono/metadata/assembly.c +--- mono-1.9.1+dfsg~/mono/metadata/assembly.c 2008-02-20 23:10:03.000000000 +0000 ++++ mono-1.9.1+dfsg/mono/metadata/assembly.c 2008-07-16 21:15:51.000000000 +0000 +@@ -590,8 +590,27 @@ + s = readlink ("/proc/self/exe", buf, sizeof (buf)-1); + + if (s != -1){ ++ /** ++ * Due to braindeadness of unionfs, we need to check the ++ * patch to see if it real, or if we're getting bogus, and ++ * then correct it as needed. ++ **/ ++ const char* prefixes[] = {"/cow/", "/persistmnt/", "/rofs/", "/rwfs/", "/squashmnt/", NULL}; ++ const char ** prefix; ++ size_t prefix_len = 0; ++ buf[sizeof(buf)-1] = '\0'; /* readlink doesn't terminate */ ++ ++ /* Go through the prefixes and see if they match */ ++ for (prefix = prefixes; *prefix; prefix++) { ++ prefix_len = strlen(buf) < strlen(*prefix) ? strlen(buf) : strlen(*prefix); ++ if (!strncmp(*prefix, buf, prefix_len)) { ++ prefix_len--; ++ break; ++ } ++ } ++ + buf [s] = 0; +- set_dirs (buf); ++ set_dirs (buf + prefix_len); + return; + } +