Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package withlock for openSUSE:Factory 
checked in at 2023-01-02 15:02:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/withlock (Old)
 and      /work/SRC/openSUSE:Factory/.withlock.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "withlock"

Mon Jan  2 15:02:10 2023 rev:11 rq:1046095 version:0.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/withlock/withlock.changes        2022-07-09 
17:05:29.264925139 +0200
+++ /work/SRC/openSUSE:Factory/.withlock.new.1563/withlock.changes      
2023-01-02 15:02:13.037367445 +0100
@@ -1,0 +2,5 @@
+Sun Jan  1 13:51:36 UTC 2023 - Bernhard Wiedemann <bwiedem...@suse.com>
+
+- Add withlock-0.5-fixboo864785.patch to fix concurrent locking (boo#864785)
+
+-------------------------------------------------------------------

New:
----
  withlock-0.5-fixboo864785.patch

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

Other differences:
------------------
++++++ withlock.spec ++++++
--- /var/tmp/diff_new_pack.juUMEX/_old  2023-01-02 15:02:13.445369738 +0100
+++ /var/tmp/diff_new_pack.juUMEX/_new  2023-01-02 15:02:13.449369761 +0100
@@ -25,6 +25,7 @@
 URL:            https://github.com/poeml/withlock
 Source0:        %{name}-%{version}.tar.gz
 Patch0:         fix-use-python3.patch
+Patch1:         withlock-0.5-fixboo864785.patch
 Requires:       python3
 BuildArch:      noarch
 

++++++ withlock-0.5-fixboo864785.patch ++++++
https://github.com/poeml/withlock/pull/5

>From 218831d810b44675c948786d3ce4d3d3180e83e0 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedem...@suse.de>
Date: Sun, 1 Jan 2023 14:43:26 +0100
Subject: [PATCH] Re-open lock file before locking

because the previous 'withlock' cleanup function might have deleted
the file and since we still held a handle to the old deleted file,
we could run concurrently with a 3rd 'withlock' which creates a new file.

Fixes #1
Fixes boo#864785

Signed-off-by: Bernhard M. Wiedemann <bwiedem...@suse.de>
---
 withlock | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/withlock b/withlock
index 01ef866..9e16f69 100755
--- a/withlock
+++ b/withlock
@@ -137,12 +137,11 @@ def main():
 
     prev_umask = os.umask(0o066)
 
-    lock = open(lockfile, 'w')
-
     global got_lock
     while 1 + 1 == 2:
 
         try:
+            lock = open(lockfile, 'w')
             fcntl.lockf(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
             got_lock = True
             break

Reply via email to