Hello community, here is the log from the commit of package yast2-core for openSUSE:Factory checked in at 2018-11-01 19:00:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-core (Old) and /work/SRC/openSUSE:Factory/.yast2-core.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-core" Thu Nov 1 19:00:44 2018 rev:184 rq:642423 version:4.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-core/yast2-core.changes 2018-07-24 17:28:36.127774939 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-core.new/yast2-core.changes 2018-11-01 19:00:48.125997913 +0100 @@ -1,0 +2,25 @@ +Tue Oct 16 16:46:48 CEST 2018 - [email protected] + +- Added license file to spec. + +------------------------------------------------------------------- +Wed Oct 3 09:59:03 UTC 2018 - [email protected] + +- Use an exclusive lock when rotating the YaST logs to avoid race + conditions when several YaST processes run in paralell + (related to bsc#1094875) +- 4.1.0 + +------------------------------------------------------------------- +Fri Sep 28 16:47:42 CEST 2018 - [email protected] + +- Reduced risk of race condition between getenv and setenv while + logging (bsc#1103076) +- 4.0.4 + +------------------------------------------------------------------- +Wed Aug 22 16:30:42 CEST 2018 - [email protected] + +- Switched license in spec file from SPDX2 to SPDX3 format. + +------------------------------------------------------------------- Old: ---- yast2-core-4.0.3.tar.bz2 New: ---- yast2-core-4.1.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-core.spec ++++++ --- /var/tmp/diff_new_pack.IOdLBy/_old 2018-11-01 19:00:48.661997957 +0100 +++ /var/tmp/diff_new_pack.IOdLBy/_new 2018-11-01 19:00:48.665997957 +0100 @@ -27,7 +27,7 @@ %bcond_with werror Name: yast2-core -Version: 4.0.3 +Version: 4.1.0 Release: 0 Url: https://github.com/yast/yast-core @@ -55,7 +55,7 @@ BuildRequires: dejagnu Summary: YaST2 - Core Libraries -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/YaST Requires: perl = %{perl_version} @@ -172,6 +172,7 @@ %{_libdir}/pkgconfig/yast2-core.pc %doc %{yast_docdir} %doc %{_datadir}/doc/yastdoc +%license COPYING %{yast_ydatadir}/devtools/bin/generateYCPWrappers %changelog ++++++ yast2-core-4.0.3.tar.bz2 -> yast2-core-4.1.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.0.3/liby2util-r/src/y2log.cc new/yast2-core-4.1.0/liby2util-r/src/y2log.cc --- old/yast2-core-4.0.3/liby2util-r/src/y2log.cc 2018-07-19 14:57:18.000000000 +0200 +++ new/yast2-core-4.1.0/liby2util-r/src/y2log.cc 2018-10-16 17:44:07.000000000 +0200 @@ -24,6 +24,7 @@ #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> +#include <sys/file.h> #include <unistd.h> #include <limits> #include <list> @@ -86,11 +87,15 @@ static bool log_all_variable = false; static bool log_simple = false; +// read getenv only once to reduce chance for race condition with setenv set by another thread +static bool y2log_should_be_buffered = getenv (Y2LOG_VAR_ONCRASH) != NULL; + static FILE *Y2LOG_STDERR = stderr; /* Default output */ /* static prototypes */ static void do_log_syslog( const char* logmessage ); static void do_log_yast( const char* logmessage ); +static void shift_log_files_if_needed_locked(string filename); /** * y2log must use a private copy of stderr, esp. in case we're always logging @@ -343,7 +348,7 @@ if(!did_set_logname) set_log_filename(""); /* Prepare the logfile */ - shift_log_files_if_needed (string (logname)); + shift_log_files_if_needed_locked (string (logname)); FILE *logfile = open_logfile (); if (!logfile) @@ -434,6 +439,32 @@ } /** + * Locking wrapper around shift_log_files_if_needed() to avoid race conditions + * when several processes access the log in parallel. This ensures only one + * process does the shift. + */ +static void shift_log_files_if_needed_locked(string filename) +{ + // locking needs a fd, so just open the file + int fd = open(filename.c_str(), O_RDONLY); + + // file does not exists or other error, do not shift the files + if (fd == -1) + return; + + // lock the file exclusively, this blocks until the lock is available + if (flock(fd, LOCK_EX) == 0) + { + // now we can do the log maintanace safely + shift_log_files_if_needed(filename); + // release the lock + flock(fd, LOCK_UN); + } + + close(fd); +} + +/** * Maintain logfiles * We do all of this ourselves because during the installation * logrotate does not run @@ -596,7 +627,7 @@ bool should_be_buffered () { - return getenv (Y2LOG_VAR_ONCRASH) != NULL; + return y2log_should_be_buffered; } // stores a few strings. can append one. can return all. old are forgotten. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.0.3/package/yast2-core.changes new/yast2-core-4.1.0/package/yast2-core.changes --- old/yast2-core-4.0.3/package/yast2-core.changes 2018-07-19 14:57:18.000000000 +0200 +++ new/yast2-core-4.1.0/package/yast2-core.changes 2018-10-16 17:44:07.000000000 +0200 @@ -1,4 +1,29 @@ ------------------------------------------------------------------- +Tue Oct 16 16:46:48 CEST 2018 - [email protected] + +- Added license file to spec. + +------------------------------------------------------------------- +Wed Oct 3 09:59:03 UTC 2018 - [email protected] + +- Use an exclusive lock when rotating the YaST logs to avoid race + conditions when several YaST processes run in paralell + (related to bsc#1094875) +- 4.1.0 + +------------------------------------------------------------------- +Fri Sep 28 16:47:42 CEST 2018 - [email protected] + +- Reduced risk of race condition between getenv and setenv while + logging (bsc#1103076) +- 4.0.4 + +------------------------------------------------------------------- +Wed Aug 22 16:30:42 CEST 2018 - [email protected] + +- Switched license in spec file from SPDX2 to SPDX3 format. + +------------------------------------------------------------------- Thu Jul 19 14:30:12 CEST 2018 - [email protected] - fixed detection of aarch64 during update by recognizing aarch64 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-core-4.0.3/package/yast2-core.spec new/yast2-core-4.1.0/package/yast2-core.spec --- old/yast2-core-4.0.3/package/yast2-core.spec 2018-07-19 14:57:18.000000000 +0200 +++ new/yast2-core-4.1.0/package/yast2-core.spec 2018-10-16 17:44:07.000000000 +0200 @@ -26,7 +26,7 @@ %bcond_with werror Name: yast2-core -Version: 4.0.3 +Version: 4.1.0 Release: 0 Url: https://github.com/yast/yast-core @@ -54,7 +54,7 @@ BuildRequires: dejagnu Summary: YaST2 - Core Libraries -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/YaST Requires: perl = %{perl_version} @@ -171,6 +171,7 @@ %{_libdir}/pkgconfig/yast2-core.pc %doc %{yast_docdir} %doc %{_datadir}/doc/yastdoc +%license COPYING %{yast_ydatadir}/devtools/bin/generateYCPWrappers %changelog
