From ee65f15ec83da1fbadc3cb15c0cca5ba9c6eb508 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 19 Jun 2017 00:27:44 -0500 Subject: Merge changes from Ubuntu. --- debian/patches/glibc-version.patch | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 debian/patches/glibc-version.patch (limited to 'debian/patches/glibc-version.patch') diff --git a/debian/patches/glibc-version.patch b/debian/patches/glibc-version.patch new file mode 100644 index 00000000..92c1b252 --- /dev/null +++ b/debian/patches/glibc-version.patch @@ -0,0 +1,40 @@ +Description: Fix checking for GLIBC version + Use ldconfig -V instead of trying to call libc.so.6 directly, and update the + string mangling in the process. +Author: Mathieu Trudel-Lapierre +Bug-Ubuntu: https://pad.lv/1473142 +Last-Update: 2017-06-19 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/modules/computer/os.c ++++ b/modules/computer/os.c +@@ -27,8 +27,7 @@ get_libc_version(void) + FILE *libc; + gchar buf[256], *tmp, *p; + char *libc_paths[] = { +- "/lib/ld-uClibc.so.0", "/lib64/ld-uClibc.so.0", +- "/lib/libc.so.6", "/lib64/libc.so.6" ++ "ldconfig -V" + }; + int i; + +@@ -47,15 +46,13 @@ get_libc_version(void) + (void)fgets(buf, 256, libc); + if (pclose(libc)) goto err; + +- tmp = strstr(buf, "version "); +- if (!tmp) goto err; ++ buf[strlen(buf) - 1] = '\0'; + +- p = strchr(tmp, ','); +- if (p) *p = '\0'; +- else goto err; ++ tmp = strstr(buf, " "); ++ if (!tmp) goto err; + + return g_strdup_printf(_("GNU C Library version %s (%sstable)"), +- strchr(tmp, ' ') + 1, ++ tmp + 1, + strstr(buf, " stable ") ? "" : _("un")); + err: + return g_strdup(_("Unknown")); -- cgit v1.2.3