olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1322544.patch

ce426f
commit 217a74a85cdd60df236c296ad88142b78d35eccf
ce426f
Author: Andreas Schwab <schwab@suse.de>
ce426f
Date:   Mon Dec 8 15:13:38 2014 +0100
ce426f
ce426f
    Don't touch user-controlled stdio locks in forked child (bug 12847)
ce426f
    
ce426f
    The stdio locks for streams with the _IO_USER_LOCK flag should not be
ce426f
    touched by internal code.
ce426f
ce426f
--- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/fork.c
ce426f
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/fork.c
ce426f
@@ -45,7 +45,8 @@
ce426f
   _IO_ITER i;
ce426f
 
ce426f
   for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
ce426f
-    _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
ce426f
+    if ((_IO_iter_file (i)->_flags & _IO_USER_LOCK) == 0)
ce426f
+      _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
ce426f
 }
ce426f
 
ce426f