Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package postsrsd for openSUSE:Factory 
checked in at 2023-03-12 16:25:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/postsrsd (Old)
 and      /work/SRC/openSUSE:Factory/.postsrsd.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "postsrsd"

Sun Mar 12 16:25:05 2023 rev:7 rq:1071002 version:2.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/postsrsd/postsrsd.changes        2023-01-24 
20:29:52.411593629 +0100
+++ /work/SRC/openSUSE:Factory/.postsrsd.new.31432/postsrsd.changes     
2023-03-12 16:26:58.885487563 +0100
@@ -1,0 +2,8 @@
+Sun Mar  5 12:31:27 UTC 2023 - Jan Engelhardt <jeng...@inai.de>
+
+- Update to release 2.0.3
+  * Close socketmap connection in main process to prevent resource
+    exhaustion
+  * Explicitly set 0666 permissions on socketmap unix socket
+
+-------------------------------------------------------------------

Old:
----
  2.0.2.tar.gz

New:
----
  2.0.3.tar.gz

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

Other differences:
------------------
++++++ postsrsd.spec ++++++
--- /var/tmp/diff_new_pack.xZwIC3/_old  2023-03-12 16:26:59.377489730 +0100
+++ /var/tmp/diff_new_pack.xZwIC3/_new  2023-03-12 16:26:59.381489747 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           postsrsd
-Version:        2.0.2
+Version:        2.0.3
 Release:        0
 Summary:        Sender Rewriting Support for postfix
 License:        GPL-2.0-only

++++++ 2.0.2.tar.gz -> 2.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/postsrsd-2.0.2/.pre-commit-config.yaml 
new/postsrsd-2.0.3/.pre-commit-config.yaml
--- old/postsrsd-2.0.2/.pre-commit-config.yaml  2023-01-06 15:48:52.000000000 
+0100
+++ new/postsrsd-2.0.3/.pre-commit-config.yaml  2023-03-03 13:29:57.000000000 
+0100
@@ -9,11 +9,11 @@
     -   id: check-yaml
     -   id: check-added-large-files
 -   repo: https://github.com/pre-commit/mirrors-clang-format
-    rev: v15.0.6
+    rev: v15.0.7
     hooks:
     -   id: clang-format
 -   repo: https://github.com/psf/black
-    rev: 22.12.0
+    rev: 23.1.0
     hooks:
     -   id: black
 -   repo: https://github.com/cheshirekow/cmake-format-precommit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/postsrsd-2.0.2/CHANGELOG.rst 
new/postsrsd-2.0.3/CHANGELOG.rst
--- old/postsrsd-2.0.2/CHANGELOG.rst    2023-01-06 15:48:52.000000000 +0100
+++ new/postsrsd-2.0.3/CHANGELOG.rst    2023-03-03 13:29:57.000000000 +0100
@@ -2,6 +2,17 @@
 Changelog
 #########
 
+2.0.3
+=====
+
+Fixed
+-----
+
+* Close socketmap connection in main process to prevent resource
+  exhaustion (`#141 <https://github.com/roehling/postsrsd/issues/141>`_)
+* Explicitly set 0666 permissions on socketmap unix socket
+  (`#141 <https://github.com/roehling/postsrsd/issues/141>`_)
+
 2.0.2
 =====
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/postsrsd-2.0.2/CMakeLists.txt 
new/postsrsd-2.0.3/CMakeLists.txt
--- old/postsrsd-2.0.2/CMakeLists.txt   2023-01-06 15:48:52.000000000 +0100
+++ new/postsrsd-2.0.3/CMakeLists.txt   2023-03-03 13:29:57.000000000 +0100
@@ -17,7 +17,7 @@
 cmake_minimum_required(VERSION 3.14...3.25)
 project(
     postsrsd
-    VERSION 2.0.2
+    VERSION 2.0.3
     LANGUAGES C
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/postsrsd-2.0.2/src/endpoint.c 
new/postsrsd-2.0.3/src/endpoint.c
--- old/postsrsd-2.0.2/src/endpoint.c   2023-01-06 15:48:52.000000000 +0100
+++ new/postsrsd-2.0.3/src/endpoint.c   2023-03-03 13:29:57.000000000 +0100
@@ -70,7 +70,6 @@
     }
     if (acquire_lock(path) > 0)
         unlink(path);
-    mode_t old_mask = umask(0);
     int sock = socket(AF_UNIX, SOCK_STREAM, 0);
     if (sock < 0)
         goto fail;
@@ -79,16 +78,16 @@
     strncpy(sa.sun_path, path, sizeof(sa.sun_path) - 1);
     if (bind(sock, (const struct sockaddr*)&sa, sizeof(struct sockaddr_un)) < 
0)
         goto fail;
+    if (chmod(path, 0666) < 0)
+        goto fail;
     if (listen(sock, POSTSRSD_SOCKET_LISTEN_QUEUE) < 0)
         goto fail;
     if ((flags = fcntl(sock, F_GETFL, 0)) < 0)
         goto fail;
     if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) < 0)
         goto fail;
-    umask(old_mask);
     return sock;
 fail:
-    umask(old_mask);
     log_perror(errno, NULL);
     if (sock >= 0)
         close(sock);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/postsrsd-2.0.2/src/main.c 
new/postsrsd-2.0.3/src/main.c
--- old/postsrsd-2.0.2/src/main.c       2023-01-06 15:48:52.000000000 +0100
+++ new/postsrsd-2.0.3/src/main.c       2023-03-03 13:29:57.000000000 +0100
@@ -366,6 +366,7 @@
                                                 local_domains, conn);
                         exit(EXIT_SUCCESS);
                     }
+                    close(conn);
                 }
             }
             waitpid(-1, NULL, WNOHANG);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/postsrsd-2.0.2/tests/blackbox/socketmap.py 
new/postsrsd-2.0.3/tests/blackbox/socketmap.py
--- old/postsrsd-2.0.2/tests/blackbox/socketmap.py      2023-01-06 
15:48:52.000000000 +0100
+++ new/postsrsd-2.0.3/tests/blackbox/socketmap.py      2023-03-03 
13:29:57.000000000 +0100
@@ -19,6 +19,7 @@
 import pathlib
 import signal
 import socket
+import stat
 import subprocess
 import sys
 import tempfile
@@ -68,8 +69,10 @@
             [faketime, when, postsrsd, "-C", str(tmpdir / "postsrsd.conf")],
             start_new_session=True,
         )
-        while not (tmpdir / "postsrsd.sock").exists():
+        wait = 50
+        while not (tmpdir / "postsrsd.sock").exists() and wait > 0:
             time.sleep(0.1)
+            wait -= 1
         try:
             yield str(tmpdir / "postsrsd.sock").encode()
         finally:
@@ -79,6 +82,8 @@
 
 def execute_queries(faketime, postsrsd, when, use_database, queries):
     with postsrsd_instance(faketime, postsrsd, when, use_database) as endpoint:
+        st = os.stat(endpoint)
+        assert st.st_mode & 0o777 == 0o666
         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
         sock.connect(endpoint)
         try:
@@ -99,7 +104,7 @@
         for nr, query in enumerate(queries, start=1):
             try:
                 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
-                sock.settimeout(0.5)
+                sock.settimeout(10)
                 sock.connect(endpoint)
                 sock.send(query)
                 result = read_netstring(sock)
@@ -113,7 +118,8 @@
                     raise AssertionError(
                         f"death_test[{query}]: FAILED: Expected connection 
closed, got: {result!r}"
                     )
-                except socket.timeout:  # TimeoutError
+                except ConnectionResetError:
+                    # Expected behavior
                     pass
                 sys.stderr.write(f"death_test[{query}]: Passed\n")
             finally:
@@ -236,6 +242,16 @@
                 ("forward test@" + "a" * (513 - 9) + ".net"),
                 "PERM Too big.",
             ),
+            # Test empty address
+            (
+                "forward ",
+                "NOTFOUND No domain.",
+            ),
+            # Test empty quotes
+            (
+                'forward ""',
+                "NOTFOUND No domain.",
+            ),
         ],
     )
     execute_death_tests(

Reply via email to