Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libzypp for openSUSE:Factory checked 
in at 2021-11-13 22:48:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libzypp (Old)
 and      /work/SRC/openSUSE:Factory/.libzypp.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libzypp"

Sat Nov 13 22:48:14 2021 rev:453 rq:930957 version:17.28.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes  2021-11-06 
18:16:54.704849798 +0100
+++ /work/SRC/openSUSE:Factory/.libzypp.new.1890/libzypp.changes        
2021-11-13 22:48:25.081244992 +0100
@@ -1,0 +2,6 @@
+Thu Nov 11 15:12:44 CET 2021 - m...@suse.de
+
+- Disable logger in the child after fork (bsc#1192436)
+- version 17.28.8 (22)
+
+-------------------------------------------------------------------

Old:
----
  libzypp-17.28.7.tar.bz2

New:
----
  libzypp-17.28.8.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.XbVxZx/_old  2021-11-13 22:48:25.913245631 +0100
+++ /var/tmp/diff_new_pack.XbVxZx/_new  2021-11-13 22:48:25.917245633 +0100
@@ -43,7 +43,7 @@
 %bcond_with enable_preview_single_rpmtrans_as_default_for_zypper
 
 Name:           libzypp
-Version:        17.28.7
+Version:        17.28.8
 Release:        0
 License:        GPL-2.0-or-later
 URL:            https://github.com/openSUSE/libzypp

++++++ libzypp-17.28.7.tar.bz2 -> libzypp-17.28.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.28.7/VERSION.cmake 
new/libzypp-17.28.8/VERSION.cmake
--- old/libzypp-17.28.7/VERSION.cmake   2021-11-04 15:19:20.000000000 +0100
+++ new/libzypp-17.28.8/VERSION.cmake   2021-11-11 15:34:28.000000000 +0100
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "17")
 SET(LIBZYPP_COMPATMINOR "22")
 SET(LIBZYPP_MINOR "28")
-SET(LIBZYPP_PATCH "7")
+SET(LIBZYPP_PATCH "8")
 #
-# LAST RELEASED: 17.28.7 (22)
+# LAST RELEASED: 17.28.8 (22)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.28.7/package/libzypp.changes 
new/libzypp-17.28.8/package/libzypp.changes
--- old/libzypp-17.28.7/package/libzypp.changes 2021-11-04 15:19:20.000000000 
+0100
+++ new/libzypp-17.28.8/package/libzypp.changes 2021-11-11 15:34:28.000000000 
+0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Thu Nov 11 15:12:44 CET 2021 - m...@suse.de
+
+- Disable logger in the child after fork (bsc#1192436)
+- version 17.28.8 (22)
+
+-------------------------------------------------------------------
 Thu Nov  4 15:16:29 CET 2021 - m...@suse.de
 
 - Check log writer before accessing it (fixes #355, bsc#1192337)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.28.7/zypp-core/base/LogControl.cc 
new/libzypp-17.28.8/zypp-core/base/LogControl.cc
--- old/libzypp-17.28.7/zypp-core/base/LogControl.cc    2021-11-03 
16:36:33.000000000 +0100
+++ new/libzypp-17.28.8/zypp-core/base/LogControl.cc    2021-11-11 
15:11:25.000000000 +0100
@@ -672,6 +672,9 @@
         {
           logControlValidFlag() = 1;
           std::call_once( flagReadEnvAutomatically, 
&LogControlImpl::readEnvVars, this);
+
+          // make sure the LogControl is invalidated when we fork
+          pthread_atfork( nullptr, nullptr, &LogControl::notifyFork );
         }
 
       public:
@@ -869,6 +872,11 @@
       LogThread::instance().stop();
     }
 
+    void LogControl::notifyFork()
+    {
+      logger::logControlValidFlag () = 0;
+    }
+
     ///////////////////////////////////////////////////////////////////
     //
     // LogControl::TmpExcessive
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libzypp-17.28.7/zypp-core/base/LogControl.h 
new/libzypp-17.28.8/zypp-core/base/LogControl.h
--- old/libzypp-17.28.7/zypp-core/base/LogControl.h     2021-08-26 
18:56:18.000000000 +0200
+++ new/libzypp-17.28.8/zypp-core/base/LogControl.h     2021-11-11 
15:11:25.000000000 +0100
@@ -148,6 +148,13 @@
       /** will cause the log thread to exit and flush all sockets */
       void emergencyShutdown();
 
+      /**
+       *  This will completely disable logging,
+       *  its supposed to be called in the child process after fork()
+       *  was called to shut down all logging completely
+       */
+      static void notifyFork();
+
     public:
       /** Get the current LineWriter */
       shared_ptr<LineWriter> getLineWriter() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libzypp-17.28.7/zypp-core/zyppng/io/forkspawnengine.cc 
new/libzypp-17.28.8/zypp-core/zyppng/io/forkspawnengine.cc
--- old/libzypp-17.28.7/zypp-core/zyppng/io/forkspawnengine.cc  2021-10-18 
12:19:44.000000000 +0200
+++ new/libzypp-17.28.8/zypp-core/zyppng/io/forkspawnengine.cc  2021-11-11 
15:11:25.000000000 +0100
@@ -9,6 +9,7 @@
 #include <zypp-core/zyppng/base/EventDispatcher>
 #include <zypp-core/zyppng/base/private/linuxhelpers_p.h>
 #include <zypp-core/base/CleanerThread_p.h>
+#include <zypp-core/base/LogControl.h>
 
 #include <cstdint>
 #include <iostream>
@@ -103,7 +104,11 @@
   const auto maxFds = ( ::getdtablesize() - 1 );
   //If the rlimits are too high we need to use a different approach
   // in detecting how many fds we need to close, or otherwise we are too slow 
(bsc#1191324)
-  if ( maxFds >= 1024 && zypp::PathInfo( "/proc/self/fd" ).isExist() ) {
+  if ( maxFds > 1024 && zypp::PathInfo( "/proc/self/fd" ).isExist() ) {
+    
+    std::vector<int> fdsToClose;
+    fdsToClose.reserve (256);
+
     zypp::filesystem::dirForEachExt( "/proc/self/fd", [&]( const 
zypp::Pathname &p, const zypp::filesystem::DirEntry &entry ){
       if ( entry.type != zypp::filesystem::FT_LINK)
         return true;
@@ -112,9 +117,14 @@
       if ( !fdVal || !canCloseFd(*fdVal) )
         return true;
 
-      ::close( *fdVal );
+      // we can not call close() directly here because 
zypp::filesystem::dirForEachExt actually has a fd open on
+      // /proc/self/fd that we would close as well. So we just remember which 
fd's we WOULD close and then do it
+      // after iterating
+      fdsToClose.push_back (*fdVal);
       return true;
     });
+    for ( int cFd : fdsToClose )
+      ::close( cFd );
   } else {
     // close all filedescriptors above the last we want to keep
     for ( int i = maxFds; i > lastFdToKeep; --i ) {
@@ -330,13 +340,13 @@
     } else if ( res == zypp::io::ReadAllResult::Ok ) {
       switch( buf.type ) {
         case ChildErrType::CHDIR_FAILED:
-          _execError = zypp::str::form( _("Can't exec '%s', chdir failed 
(%s)."), _args[0].c_str(), strerror(buf.childErrno) );
+          _execError = zypp::str::form( _("Can't exec '%s', chdir failed 
(%s)."), _args[0].c_str(), zypp::str::strerror(buf.childErrno).c_str() );
           break;
         case ChildErrType::CHROOT_FAILED:
-          _execError = zypp::str::form( _("Can't exec '%s', chroot failed 
(%s)."), _args[0].c_str(), strerror(buf.childErrno) );
+          _execError = zypp::str::form( _("Can't exec '%s', chroot failed 
(%s)."), _args[0].c_str(), zypp::str::strerror(buf.childErrno).c_str() );
           break;
         case ChildErrType::EXEC_FAILED:
-          _execError = zypp::str::form( _("Can't exec '%s', exec failed 
(%s)."), _args[0].c_str(), strerror(buf.childErrno) );
+          _execError = zypp::str::form( _("Can't exec '%s', exec failed 
(%s)."), _args[0].c_str(), zypp::str::strerror(buf.childErrno).c_str() );
           break;
         // all other cases need to be some sort of error, because we only get 
data if the exec fails
         default:

Reply via email to