Sync from SUSE:SLFO:Main pam_wrapper revision c964abf168fffdd4fc87a3335a4d542b

This commit is contained in:
Adrian Schröter 2024-05-03 17:40:39 +02:00
commit 7dbbb780bd
7 changed files with 466 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
pam_wrapper-1.1.4.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEjf9T4Y8qvI2PPJIjfuD8TcwBTj0FAmF6YZYACgkQfuD8TcwB
Tj0dCA//drNm6b6q3GhW1CX5Gksc9mNCbatwHYZMCOz1Km1TXEM6pQzIYU4JJiIX
yRARln4dlrNHifsUbKOL0ipoRiCzBXeN1NK47TbefOB0vumykJwuG6LNBzbAz+a4
iAZfvT5D2OPEJG7fkB5Pr97/AD09y5T8LlqphIsMDWTFuDErqm19MwfCgdaLA2jU
3qA9MR88HTg5wyQIJ5cfjz1qVWfQlFUxsUy+D39HE7IotAxZISfJn8+mDToznFoG
ZD0O4oMEUOvMelQPNeHworihlEVaTz9/k5VtTWAE70PzEQgxNWq1C8WOJpJ2TUDD
H8aE0/6UC2u9ava5fUuzBeIaz4hqsnKIdgeLMxne9PoSLSyyAnjRseWwdhAiJmnh
0JzKoqrB8bFQ446por2lBkJcph23w2jhrLPm/6nupndSFPPU0VKzA0R2MmR3T6JW
wmJO3Eqs04P59k+4vxog9/AqHip6VF4WGtmE1sVwZdEeMEfBkXINUF31NIigCHkB
1n1mbzxBTFb16+Qur0QpmeE5jLL/X1WWx6qWMcVZCxpNGarIjd18aMmiQmqO+ilU
KYbdxc9ssCb/oyWHBLJW/jVzpBwUiN93I7iQaqb+2Se1Y9PI/E5mA2OHFiIXDpU5
m39WX2jK9c393jlRY+geg2AQlYQ6I4TFdk1USiaMeZT6HuqMFTg=
=wA4W
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,107 @@
From 9e7f8ac9ee1f968ac8af2d9c2e9dbd91a3090b73 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 17 Feb 2023 18:08:45 +0100
Subject: [PATCH 1/2] cmake: Drop FindCMocka.cmake Module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We should use config mode.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
---
cmake/Modules/FindCMocka.cmake | 49 ----------------------------------
1 file changed, 49 deletions(-)
delete mode 100644 cmake/Modules/FindCMocka.cmake
diff --git a/cmake/Modules/FindCMocka.cmake b/cmake/Modules/FindCMocka.cmake
deleted file mode 100644
index 2dd9fc5..0000000
--- a/cmake/Modules/FindCMocka.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
-# - Try to find CMocka
-# Once done this will define
-#
-# CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
-#
-# Read-Only variables:
-# CMOCKA_FOUND - system has CMocka
-# CMOCKA_INCLUDE_DIR - the CMocka include directory
-# CMOCKA_LIBRARIES - Link these to use CMocka
-# CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
-#
-#=============================================================================
-# Copyright (c) 2011-2012 Andreas Schneider <asn@cryptomilk.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-#
-
-find_path(CMOCKA_INCLUDE_DIR
- NAMES
- cmocka.h
- PATHS
- ${CMOCKA_ROOT_DIR}/include
-)
-
-find_library(CMOCKA_LIBRARY
- NAMES
- cmocka
- PATHS
- ${CMOCKA_ROOT_DIR}/include
-)
-
-if (CMOCKA_LIBRARY)
- set(CMOCKA_LIBRARIES
- ${CMOCKA_LIBRARIES}
- ${CMOCKA_LIBRARY}
- )
-endif (CMOCKA_LIBRARY)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)
-
-# show the CMOCKA_INCLUDE_DIR and CMOCKA_LIBRARIES variables only in the advanced view
-mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARIES)
--
2.39.2
From 8e94874bf5c0d569a16985eafa9922d8c527a9fb Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 17 Feb 2023 17:51:27 +0100
Subject: [PATCH 2/2] 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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 9d56f21..26f2da2 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,9 @@
project(tests C)
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
set(PAM_MATRIX_PATH "${CMAKE_BINARY_DIR}/src/modules/pam_matrix.so")
configure_file(services/matrix.in ${CMAKE_CURRENT_BINARY_DIR}/services/matrix @ONLY)
--
2.39.2

11
pam_wrapper-rpmlintrc Normal file
View File

@ -0,0 +1,11 @@
# 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("shlib-fixed-dependency")
addFilter("shlib-policy-missing-suffix")
addFilter("devel-file-in-non-devel-package")

130
pam_wrapper.changes Normal file
View File

@ -0,0 +1,130 @@
-------------------------------------------------------------------
Mon Feb 27 09:38:30 UTC 2023 - Andreas Schneider <asn@cryptomilk.org>
- Fix building with cmocka >= 1.1.6
* Added pam_wrapper-fix-cmocka-1.1.6+-support.patch
-------------------------------------------------------------------
Thu Oct 28 08:40:28 UTC 2021 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.1.4
* https://gitlab.com/cwrap/pam_wrapper/-/blob/pam_wrapper-1.1.4/CHANGELOG
-------------------------------------------------------------------
Wed May 20 07:02:41 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Fix the build (remove py2 lib if built without py2 support)
-------------------------------------------------------------------
Thu Mar 26 13:36:14 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.1.3
* https://gitlab.com/cwrap/pam_wrapper/-/blob/master/CHANGELOG
-------------------------------------------------------------------
Tue Mar 24 13:51:58 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.1.2
* https://gitlab.com/cwrap/pam_wrapper/-/blob/master/CHANGELOG
-------------------------------------------------------------------
Tue Mar 24 13:21:09 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.1.1
* https://gitlab.com/cwrap/pam_wrapper/-/blob/master/CHANGELOG
-------------------------------------------------------------------
Fri Mar 20 14:13:05 UTC 2020 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.1.0
* Added support for pam_start_confdir()
* Added pam_chatty module
* Added gitlab CI support
* Fixed crash when a PAM module outputs too much data
- Removed pam_wrapper-1.0.8-fix_with_latest_pam.patch
- Removed fix-pam-module-output-crash.patch
-------------------------------------------------------------------
Thu Mar 19 08:07:02 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix crash when testing fprintd:
* fix-pam-module-output-crash.patch
- Fix build without python2 that is atm being removed from Tumbleweed
- Use cmake macros for build
-------------------------------------------------------------------
Mon Dec 9 15:11:23 UTC 2019 - Andreas Schneider <asn@cryptomilk.org>
- Fix pam_wrapper with Linux-PAM master
- Added pam_wrapper-1.0.8-fix_with_latest_pam.patch
-------------------------------------------------------------------
Tue Jul 16 09:42:49 UTC 2019 - Andreas Schneider <asn@cryptomilk.org>
- Build documentation in the build stage
- Use ctest macro
-------------------------------------------------------------------
Wed Sep 26 12:56:51 UTC 2018 - Andreas Schneider <asn@cryptomilk.org>
- Update to version 1.0.7
* Added support for running with AddressSanitizer
* Added logging for pam_set_items module
* Fixed building python modules
* Fixed pam conversation in libpamtest
-------------------------------------------------------------------
Thu Feb 22 15:56:44 UTC 2018 - asn@cryptomilk.org
- Update to version 1.0.5
* Added support to build python2 and python3 module at the same time
* Improved pam test directory creating
* Fixed python 2.6 compatibilty
* Fixed some build issues on FreeBSD
* Fix build on OpenBSD
* Fix a resource leak
- Removed pam_wrapper-1.0.3-build-python2-and-python3-modules.patch
-------------------------------------------------------------------
Mon Feb 12 11:56:57 UTC 2018 - asn@cryptomilk.org
- Build python2 and python3 packages
- Added pam_wrapper-1.0.3-build-python2-and-python3-modules.patch
-------------------------------------------------------------------
Sun Feb 4 09:31:44 UTC 2018 - asn@cryptomilk.org
- Add missing build require to python-rpm-macros
-------------------------------------------------------------------
Fri Apr 7 14:22:09 UTC 2017 - asn@cryptomilk.org
- Update to version 1.0.3
* Fixed some build issues with strict compiler flags
* Logging to syslog is disabled by default
-------------------------------------------------------------------
Tue May 31 06:58:44 UTC 2016 - asn@cryptomilk.org
- Update to version 1.0.2
* Fixed pam_wrapper on some BSDs
* Fixed simple conversation in libpamtest
-------------------------------------------------------------------
Sun Feb 14 10:53:47 UTC 2016 - jengelh@inai.de
- Editorial fixes to the descriptions
-------------------------------------------------------------------
Mon Jan 18 10:13:41 UTC 2016 - asn@cryptomilk.org
- Update to version 1.0.1
* Fixed issue with audit_open() and sshd
* Fixed several issues found by Coverity
* Fixed python linking issues
-------------------------------------------------------------------
Thu Jan 14 16:13:36 UTC 2016 - asn@cryptomilk.org
- Initial package

176
pam_wrapper.spec Normal file
View File

@ -0,0 +1,176 @@
#
# spec file for package pam_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 ##################################
%bcond_without python2
Name: pam_wrapper
Version: 1.1.4
Release: 0
Summary: A tool to test PAM applications and PAM modules
License: GPL-3.0-or-later
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: %{name}-rpmlintrc
Patch0: pam_wrapper-fix-cmocka-1.1.6+-support.patch
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: libcmocka-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(python3)
Recommends: cmake
Recommends: pkgconfig
%if %{with python2}
BuildRequires: pkgconfig(python2)
%endif
%description
This component of cwrap allows you to either test your PAM (Linux-PAM
and OpenPAM) application or module.
For testing PAM applications, a simple PAM module called pam_matrix is
included. If you plan to test a PAM module, you can use the pamtest library,
which simplifies testing of modules. You can combine it with the cmocka
unit testing framework, or you can use the provided Python bindings to
write tests for your module in Python.
This package does not have a devel package, because this project is for
development/testing.
%package -n libpamtest0
Summary: A tool to test PAM applications and PAM modules
Requires: pam_wrapper = %{version}-%{release}
%description -n libpamtest0
If you plan to test a PAM module, you can use this library, which simplifies
testing of modules.
%package -n libpamtest-devel
Summary: A tool to test PAM applications and PAM modules
Requires: libpamtest0 = %{version}-%{release}
Requires: pam_wrapper = %{version}-%{release}
Recommends: cmake
Recommends: pkgconfig
%description -n libpamtest-devel
If you plan to develop tests for a PAM module, you can use this library,
which simplifies testing of modules. This subpackage includes the header
files for libpamtest
%package -n libpamtest-devel-doc
Summary: The libpamtest API documentation
%description -n libpamtest-devel-doc
Documentation for libpamtest development.
%package -n python2-libpamtest
Summary: A python wrapper for libpamtest
Requires: libpamtest0 = %{version}-%{release}
Requires: pam_wrapper = %{version}-%{release}
%description -n python2-libpamtest
If you plan to develop python tests for a PAM module, you can use this
library, which simplifies testing of modules. This subpackage includes
the header files for libpamtest
%package -n python3-libpamtest
Summary: A python wrapper for libpamtest
Requires: libpamtest0 = %{version}-%{release}
Requires: pam_wrapper = %{version}-%{release}
%description -n python3-libpamtest
If you plan to develop python tests for a PAM module, you can use this
library, which simplifies testing of modules. This subpackage includes
the header files for libpamtest
%prep
%autosetup -p1
%build
# CMAKE_SKIP_RPATH:BOOL=OFF is required to run the tests!
%cmake \
-DUNIT_TESTING=ON \
-DCMAKE_SKIP_RPATH:BOOL=OFF
%cmake_build
%cmake_build doc
%install
%cmake_install
%if %{without python2}
rm -rf %{python2_sitearch}/pypamtest.so
%endif
%check
%ctest
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n libpamtest0 -p /sbin/ldconfig
%postun -n libpamtest0 -p /sbin/ldconfig
%files
%doc AUTHORS README.md CHANGELOG
%license LICENSE
%{_libdir}/libpam_wrapper.so*
%{_libdir}/pkgconfig/pam_wrapper.pc
%dir %{_libdir}/cmake/pam_wrapper
%{_libdir}/cmake/pam_wrapper/pam_wrapper-config-version.cmake
%{_libdir}/cmake/pam_wrapper/pam_wrapper-config.cmake
%dir %{_libdir}/pam_wrapper
%{_libdir}/pam_wrapper/pam_matrix.so
%{_libdir}/pam_wrapper/pam_chatty.so
%{_libdir}/pam_wrapper/pam_get_items.so
%{_libdir}/pam_wrapper/pam_set_items.so
%{_mandir}/man1/pam_wrapper.1%{?ext_man}
%{_mandir}/man8/pam_chatty.8%{?ext_man}
%{_mandir}/man8/pam_matrix.8%{?ext_man}
%{_mandir}/man8/pam_get_items.8%{?ext_man}
%{_mandir}/man8/pam_set_items.8%{?ext_man}
%files -n libpamtest0
%{_libdir}/libpamtest.so.*
%files -n libpamtest-devel
%{_libdir}/libpamtest.so
%{_libdir}/pkgconfig/libpamtest.pc
%dir %{_libdir}/cmake/pamtest
%{_libdir}/cmake/pamtest/pamtest-config-version.cmake
%{_libdir}/cmake/pamtest/pamtest-config-relwithdebinfo.cmake
%{_libdir}/cmake/pamtest/pamtest-config.cmake
%{_includedir}/libpamtest.h
%files -n libpamtest-devel-doc
%doc build/doc/html
%if %{with python2}
%files -n python2-libpamtest
%{python2_sitearch}/pypamtest.so
%endif
%files -n python3-libpamtest
%{python3_sitearch}/pypamtest.so
%changelog