Package: eatmydata
Version: 26-2.1
Tags: patch
Severity: wishlist

Hi.

I've just uploaded a NMU to the delayed queue, due to enter unstable
in 5 days, containing the attached patch for libeatmydata, to fix a
bug affecting debian-edu-install.

-- 
Happy hacking
Petter Reinholdtsen
diff -Nru libeatmydata-26/debian/changelog libeatmydata-26/debian/changelog
--- libeatmydata-26/debian/changelog    2011-02-19 13:28:02.000000000 +0100
+++ libeatmydata-26/debian/changelog    2014-09-27 22:57:16.000000000 +0200
@@ -1,3 +1,12 @@
+libeatmydata (26-2.1) unstable; urgency=low
+
+  * Non-maintainer upload to fix bug affecting other packages.
+  * Make sure open() calls done before the eatmydata_init(), for example
+    called by ctors, do not return an unexpected error (Closes:
+    #702711).  Patch by Roland Stigge.
+
+ -- Petter Reinholdtsen <p...@debian.org>  Sat, 27 Sep 2014 22:57:11 +0200
+
 libeatmydata (26-2) unstable; urgency=low
 
   * Switch homepage to launchpad.net/libeatmydata.
diff -Nru libeatmydata-26/debian/patches/bug-702711.patch 
libeatmydata-26/debian/patches/bug-702711.patch
--- libeatmydata-26/debian/patches/bug-702711.patch     1970-01-01 
01:00:00.000000000 +0100
+++ libeatmydata-26/debian/patches/bug-702711.patch     2014-09-27 
22:55:32.000000000 +0200
@@ -0,0 +1,38 @@
+Description: Do not fail when open() is called before eatmydata is initialized
+ Make sure open() calls done before the eatmydata_init(), for example
+ called by ctors, do not return an unexpected error.
+Author: Roland Stigge <sti...@antcom.de>
+Bug-Debian: http://bugs.debian.org/702711
+
+Reviewed-By: Petter Reinholdtsen <p...@hungry.com>
+Last-Update: 2014-09-27
+
+--- libeatmydata-26.orig/eatmydata.c
++++ libeatmydata-26/eatmydata.c
+@@ -44,13 +44,17 @@ static int (*libc_msync)(void*, size_t,
+         if (!libc_##name || dlerror())                                \
+                 _exit(1);
+ 
++static int initing = 0;
++
+ void __attribute__ ((constructor)) eatmydata_init(void)
+ {
++      initing = 1;
+       ASSIGN_DLSYM_OR_DIE(open);
+       ASSIGN_DLSYM_OR_DIE(fsync);
+       ASSIGN_DLSYM_OR_DIE(sync);
+       ASSIGN_DLSYM_OR_DIE(fdatasync);
+       ASSIGN_DLSYM_OR_DIE(msync);
++      initing = 0;
+ }
+ 
+ int eatmydata_is_hungry(void)
+@@ -109,7 +113,7 @@ int open(const char* pathname, int flags
+ 
+       /* In pthread environments the dlsym() may call our open(). */
+       /* We simply ignore it because libc is already loaded       */
+-      if (!libc_open) {
++      if (initing) {
+               errno = EFAULT;
+               return -1;
+       }
diff -Nru libeatmydata-26/debian/patches/series 
libeatmydata-26/debian/patches/series
--- libeatmydata-26/debian/patches/series       1970-01-01 01:00:00.000000000 
+0100
+++ libeatmydata-26/debian/patches/series       2014-09-27 22:54:00.000000000 
+0200
@@ -0,0 +1 @@
+bug-702711.patch

Reply via email to