Sync from SUSE:SLFO:Main socket_wrapper revision bb884057acc03b645e5cb4aa71738a62

This commit is contained in:
Adrian Schröter 2024-05-04 00:44:20 +02:00
commit 4de1609883
8 changed files with 441 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
socket_wrapper-1.4.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEjf9T4Y8qvI2PPJIjfuD8TcwBTj0FAmPHvdgACgkQfuD8TcwB
Tj2q8g/7BlqS00E/JDGHSDiHFNjhtjey53nrrJ9Fbog6fPiI0SkjwrPotbE37rct
K5fGI+9HvyLGiG6XXERuUYhdoxt32Zlmdk0XSJbT1OZV2k3vjGR080w+mV/mcRMu
kC9ix+9vKiHkO6QfOEUwkv3C3IDyp/FHju61hossORcuiL3Kk+AVoGaoxfBgC29D
8/+g2Q0yNOLnF3+GUMODmYAs7s4CqcXys4AulXW6XwHwH8hIi3bDmUpNtUTGkjxY
8ZoWOgpHsvBiEQ0LpPJckRXbXPhf6TnX9orwGjrPDmBoRAcPt9prc5mLMThvltuX
BHa3tkyyOg7sUzK15S+HLQ1fDERMHcV6J97UzM/GW0DCuh2XxpXaayACkp3/8dLU
Tvz+M/YB82yikvK0ksW9KzCtxkk8f3UoCnhHCzwIjSeAnED1KUrQkqmctuK5t8MN
CnNLvpTLXLvRa3SbsFc/KnKa759TuLT3Zcz2//iNLZSDIQPQ1pWybY2x7KYqobpN
7dKXlwwrjvC4WUgMl8XOvMgngXYUiTPB7KQMqpyeqi3mBjWYAMsj7GMwkPYHPRDD
4tR8DZ9cbEPumcol2IxAEJUZaWHeBYbwMwq+EknUHe7d1V5gMbohZIKJbgzRZVpm
ieoxl0FyyUhNIiHqm59TAGSKlKds75sX0kg3NqVo6So6vFcQCPo=
=EBbQ
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,33 @@
From 97fe09e583f6e2ef94623c872e0c56bcd8817303 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 17 Feb 2023 17:51:27 +0100
Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
---
tests/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 6c3aae9..3748461 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,6 +7,11 @@ include_directories(
${CMOCKA_INCLUDE_DIR}
)
+# Required for cmocka >= 1.1.6
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
set(TORTURE_LIBRARY torture)
# RFC862 echo server
--
2.39.2

10
socket_wrapper-rpmlintrc Normal file
View File

@ -0,0 +1,10 @@
# This is a special library only for testing purposes. You cannot link this
# library. It is only inteded to be used with LD_PRELOAD. This package is
# the devel package.
#
# Learn more at http://cwrap.org
#
addFilter("shlib-policy-name-error")
addFilter("shared-lib-calls-exit")
addFilter("devel-file-in-non-devel-package")
addFilter("shared-lib-without-dependency-information")

244
socket_wrapper.changes Normal file
View File

@ -0,0 +1,244 @@
-------------------------------------------------------------------
Thu Feb 23 14:24:07 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
- Fix building with cmocka >= 1.1.6
* Added socket_wrapper-fix-cmocka-1.1.6+-support.patch
-------------------------------------------------------------------
Wed Jan 18 09:39:24 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.4.0
* Added support for sendmmsg()/recvmmsg()
* Added support for handling close, recvmmsg and sendmmsg syscalls
* Added support to interact with uid_wrapper syscall()
* Improved IP address tracing output
-------------------------------------------------------------------
Thu Nov 24 09:40:58 UTC 2022 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.3.5
* Inject O_LARGEFILE as needed on 32bit
* pkgconfig: Fix path to libsocket_wrapper.so
* Fix -Wcast-qual warnings
* Fix dclose(RTLD_NEXT)
-------------------------------------------------------------------
Thu Jul 21 12:53:16 UTC 2022 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.3.4
* Fixed TOCTOU issue with udp auto binding
* Fixed running on FreeBSD
-------------------------------------------------------------------
Wed Mar 17 08:55:12 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.3.3
* Added public libsocket_wrapper_noop library
* Added wrapper for wrap __close_nocancel()
* Fixed possible deadlock in swrap_pcap_dump_packet()
* Fixed issue when writing pcap files
-------------------------------------------------------------------
Wed Feb 10 15:57:41 UTC 2021 - Jan Engelhardt <jengelh@inai.de>
- Drop obsolete specfile constructs. Remove extraneous Recommends
(no other package of the kind would have these).
- Trim filler wording from descriptions.
-------------------------------------------------------------------
Wed Feb 10 14:50:02 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.3.2
* https://gitlab.com/cwrap/socket_wrapper/-/blob/socket_wrapper-1.3.2/CHANGELOG
-------------------------------------------------------------------
Fri Feb 5 14:58:06 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.3.1
* Fixed copy on write leak of ~38M for every fork
* Fixed issue with accept() on FreeBSD
* Fixed fd-passing on 32bit platforms
* Fixed invalid read in swrap_sendmsg_unix_scm_rights()
-------------------------------------------------------------------
Wed Feb 3 14:02:04 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.3.0
* https://gitlab.com/cwrap/socket_wrapper/-/blob/socket_wrapper-1.3.0/CHANGELOG
-------------------------------------------------------------------
Mon Jun 22 15:05:19 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.2.5
* https://gitlab.com/cwrap/socket_wrapper/-/blob/master/CHANGELOG
-------------------------------------------------------------------
Tue Mar 24 13:12:47 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.2.4
* https://gitlab.com/cwrap/socket_wrapper/-/blob/master/CHANGELOG
-------------------------------------------------------------------
Thu Oct 31 11:55:39 UTC 2019 - Andreas Schneider <asn@cryptomilk.org>
- Some spec file cleanups
-------------------------------------------------------------------
Wed Aug 21 09:08:54 UTC 2019 - Andreas Schneider <asn@cryptomilk.org>
- Change Requires to Recommends for cmake and pkgconf
-------------------------------------------------------------------
Thu Mar 21 14:02:58 UTC 2019 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.2.3
* Fixed missing NULL check for socket_wrapper_dir()
* Fixes building in Samba source tree
-------------------------------------------------------------------
Thu Mar 21 09:00:55 UTC 2019 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.2.2
* Added environment variable to disable deep binding
* Fixed installation of socket_wrapper
* Fixed several small bugs
-------------------------------------------------------------------
Wed Nov 14 08:43:12 UTC 2018 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.2.1
* Removed error message to fix applications doing stupid things
-------------------------------------------------------------------
Tue Nov 13 13:10:34 UTC 2018 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.2.0
* Added threading support
* Moved to modern cmake
* Several smaller bugfixes
-------------------------------------------------------------------
Mon Dec 4 11:22:22 UTC 2017 - asn@cryptomilk.org
- Update to version 1.1.9
* Fixed thread - signal deadlock issue
-------------------------------------------------------------------
Fri Oct 13 08:50:38 UTC 2017 - asn@cryptomilk.org
- Update to version 1.1.8
* Added support for openat()
* Added support for open64() and fopen64()
* Always enabled logging support
* Increased maximum for wrapped interfaces to 64
* Improved fd duplication code
* Fixed strict-aliasing issues
* Fixed some use after free issues
* Fixed issues on ppc64le
-------------------------------------------------------------------
Tue May 31 06:57:22 UTC 2016 - asn@cryptomilk.org
- Update to version 1.1.7
* Added support for accept4()
* Added support for OpenBSD
* Fixed sendto() with UDP and a connected socket
* Fixed AF_RAWLINK sockets
-------------------------------------------------------------------
Mon Mar 21 18:21:00 UTC 2016 - asn@cryptomilk.org
- Update to version 1.1.6
* Added a wrapper for write()
* Added support for automatic binding of ephemeral ports
* Fixed recvmsg() with UDP
* Fixed AF_NETLINK sockets
-------------------------------------------------------------------
Sun Feb 14 11:46:13 UTC 2016 - jengelh@inai.de
- Editorial fixes to the description
-------------------------------------------------------------------
Thu Oct 15 09:15:14 UTC 2015 - asn@cryptomilk.org
- Update to version 1.1.5
* Added support for TCP_NODELAY in setsockopt/getsockopt
* Fixed cmsg space calculation
-------------------------------------------------------------------
Wed Sep 2 11:53:38 UTC 2015 - asn@cryptomilk.org
- Update to version 1.1.4
* Fixed handling of msg_name in recvmsg()
* Fixed sendmsg()/recvmsg() TCP support
* Fixed several compile warnings
* Added environment variable to change MTU
-------------------------------------------------------------------
Tue May 12 07:16:12 UTC 2015 - mpluskal@suse.com
- Rename rpmlintrc so that it complies packaging conventions
-------------------------------------------------------------------
Mon May 11 07:52:41 UTC 2015 - mpluskal@suse.com
- Mention rpmlintrc as source
-------------------------------------------------------------------
Mon May 11 06:22:55 UTC 2015 - asn@cryptomilk.org
- Revert library package.
-------------------------------------------------------------------
Mon May 11 06:16:38 UTC 2015 - asn@cryptomilk.org
- Revert package split
- Require pkg-config and cmake
-------------------------------------------------------------------
Tue May 5 15:59:09 UTC 2015 - mpluskal@suse.com
- Cleanup spec file
- Use %cmake install macro
- Split package
- Remove rpmlintrc
-------------------------------------------------------------------
Mon Feb 23 15:54:22 UTC 2015 - asn@cryptomilk.org
- Update to version 1.1.3
* Added support for address sanitizer.
* Fixed leaking of memory and fds of stale sockets.
* Fixed the library loading code.
-------------------------------------------------------------------
Thu Oct 2 09:42:58 UTC 2014 - asn@cryptomilk.org
- Update to version 1.1.2
* Added support for fnctl(F_DUPFD).
* Added support for glibc 2.20.90.
-------------------------------------------------------------------
Thu Sep 11 14:57:22 UTC 2014 - asn@cryptomilk.org
- Update to version 1.1.1
* Disable incomplete address in use check in bind().
* Added support for IP_PKTINFO in recvmsg().
* Added support for IPV6_PKTINFO in recvmsg().
* Added support for IP_RECVDSTADDR in recvmsg() on BSD.
* Added support for more socket options in getsockopt().
* Added support for bindresvport().
* Fixed rebinding on connect().
* Fixed sockaddr buffer truncation in getsockname() and getpeername().
* Fixed special cases in bind().
* Fixed loading libc on some platforms.
* Fixed memory leaks
* Fixed calling open from libc.
* Fixed loading libc functions on some platforms.
-------------------------------------------------------------------
Thu Feb 13 10:22:38 UTC 2014 - asn@cryptomilk.org
- Initial package.

BIN
socket_wrapper.keyring Normal file

Binary file not shown.

112
socket_wrapper.spec Normal file
View File

@ -0,0 +1,112 @@
#
# spec file for package socket_wrapper
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
############################# NOTE ##################################
#
# This is a special library. You are not able to link this library.
# Do NOT create library package or a devel package!
#
############################# NOTE ##################################
Name: socket_wrapper
Version: 1.4.0
Release: 0
Summary: A library passing all socket communications through Unix sockets
License: BSD-3-Clause
Group: Development/Libraries/C and C++
URL: https://cwrap.org/
#
Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
Source1: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc
Source2: socket_wrapper.keyring
Source3: %{name}-rpmlintrc
Patch0: socket_wrapper-fix-cmocka-1.1.6+-support.patch
#
BuildRequires: cmake
BuildRequires: libcmocka-devel
BuildRequires: pkg-config
%description
socket_wrapper helps client/server software development to gain functional test
coverage. It can run several instances of a software stack on the same machine
and perform functional testing of network configurations locally.
To use it, set the following environment variables:
LD_PRELOAD=libsocket_wrapper.so
SOCKET_WRAPPER_DIR=/path/to/swrap_dir
%package -n libsocket_wrapper_noop0
Summary: A library providing dummies for socket_wrapper
%description -n libsocket_wrapper_noop0
Applications with the need to call socket_wrapper_enabled() should link against
-lsocket_wrapper_noop in order to resolve the symbol at link time.
%package -n libsocket_wrapper_noop-devel
Summary: Development headers for libsocket_wrapper_noop
Requires: libsocket_wrapper_noop0 = %{version}
%description -n libsocket_wrapper_noop-devel
Development headers for applications with the need to call
socket_wrapper_enabled().
%prep
%autosetup -p1
%build
%cmake \
-DUNIT_TESTING=ON
%make_build VERBOSE=1
%install
%cmake_install
%check
%ctest
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n libsocket_wrapper_noop0 -p /sbin/ldconfig
%postun -n libsocket_wrapper_noop0 -p /sbin/ldconfig
%files
%doc AUTHORS README.md CHANGELOG
%license LICENSE
%{_libdir}/libsocket_wrapper.so.*
%{_mandir}/man1/socket_wrapper.1*
%{_libdir}/libsocket_wrapper.so
%dir %{_libdir}/cmake/socket_wrapper
%{_libdir}/cmake/socket_wrapper/socket_wrapper-config-version.cmake
%{_libdir}/cmake/socket_wrapper/socket_wrapper-config.cmake
%{_libdir}/pkgconfig/socket_wrapper.pc
%files -n libsocket_wrapper_noop0
%{_libdir}/libsocket_wrapper_noop.so.*
%files -n libsocket_wrapper_noop-devel
%{_includedir}/socket_wrapper.h
%{_libdir}/libsocket_wrapper_noop.so
%{_libdir}/cmake/socket_wrapper/socket_wrapper_noop-config*.cmake
%{_libdir}/pkgconfig/socket_wrapper_noop.pc
%changelog