dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0081-ci-do-not-build-secrets-on-rhel6.patch

bb7cd1
From c9358747b25b257d82b050967812e54860fe7685 Mon Sep 17 00:00:00 2001
bb7cd1
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
bb7cd1
Date: Tue, 28 Mar 2017 15:24:01 +0200
bb7cd1
Subject: [PATCH 81/90] ci: do not build secrets on rhel6
bb7cd1
MIME-Version: 1.0
bb7cd1
Content-Type: text/plain; charset=UTF-8
bb7cd1
Content-Transfer-Encoding: 8bit
bb7cd1
bb7cd1
We require newer libcurl version than is available on rhel6. We don't
bb7cd1
ship secrets responder in rhel6 so we just disable its build.
bb7cd1
bb7cd1
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
bb7cd1
(cherry picked from commit 6698d40512e55e7c2d03e14c227c51b1edc77ffa)
bb7cd1
---
bb7cd1
 contrib/ci/configure.sh        |  1 +
bb7cd1
 contrib/sssd.spec.in           | 15 +++++++++++++++
bb7cd1
 src/tests/intg/test_secrets.py |  4 ++++
bb7cd1
 3 files changed, 20 insertions(+)
bb7cd1
bb7cd1
diff --git a/contrib/ci/configure.sh b/contrib/ci/configure.sh
bb7cd1
index 7590743c2aa5fe31bcdf1a3e92a3f482dbec699b..9d18d0c187561a2dc3bc47d3e8913626e7ff3046 100644
bb7cd1
--- a/contrib/ci/configure.sh
bb7cd1
+++ b/contrib/ci/configure.sh
bb7cd1
@@ -38,6 +38,7 @@ if [[ "$DISTRO_BRANCH" == -redhat-redhatenterprise*-6.*- ||
bb7cd1
         "--disable-cifs-idmap-plugin"
bb7cd1
         "--with-syslog=syslog"
bb7cd1
         "--without-python3-bindings"
bb7cd1
+        "--without-secrets"
bb7cd1
         "--without-kcm"
bb7cd1
     )
bb7cd1
 fi
bb7cd1
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
bb7cd1
index af14d4e3d6b9ffeb4696f1517113b8daa575cb99..39a974edebba3dbcd7625d1729b4a7330eaa8a27 100644
bb7cd1
--- a/contrib/sssd.spec.in
bb7cd1
+++ b/contrib/sssd.spec.in
bb7cd1
@@ -112,6 +112,12 @@
bb7cd1
     %global enable_systemtap_opt --enable-systemtap
bb7cd1
 %endif
bb7cd1
 
bb7cd1
+%if (0%{?fedora} || 0%{?epel} >= 7)
bb7cd1
+    %global with_secrets 1
bb7cd1
+%else
bb7cd1
+    %global with_secret_responder --without-secrets
bb7cd1
+%endif
bb7cd1
+
bb7cd1
 %if (0%{?fedora} >= 23 || 0%{?rhel} >= 7)
bb7cd1
     %global with_kcm 1
bb7cd1
     %global with_kcm_option --with-kcm
bb7cd1
@@ -220,8 +226,10 @@ BuildRequires: libsmbclient-devel
bb7cd1
 %if (0%{?enable_systemtap} == 1)
bb7cd1
 BuildRequires: systemtap-sdt-devel
bb7cd1
 %endif
bb7cd1
+%if (0%{?with_secrets} == 1)
bb7cd1
 BuildRequires: http-parser-devel
bb7cd1
 BuildRequires: jansson-devel
bb7cd1
+%endif
bb7cd1
 BuildRequires: libuuid-devel
bb7cd1
 BuildRequires: libcurl-devel
bb7cd1
 
bb7cd1
@@ -727,6 +735,7 @@ autoreconf -ivf
bb7cd1
     %{?with_python3_option} \
bb7cd1
     %{?enable_polkit_rules_option} \
bb7cd1
     %{?enable_systemtap_opt} \
bb7cd1
+    %{?with_secret_responder} \
bb7cd1
     %{?with_kcm_option} \
bb7cd1
     %{?experimental}
bb7cd1
 
bb7cd1
@@ -865,7 +874,9 @@ done
bb7cd1
 %{_libexecdir}/%{servicename}/sssd_nss
bb7cd1
 %{_libexecdir}/%{servicename}/sssd_pam
bb7cd1
 %{_libexecdir}/%{servicename}/sssd_autofs
bb7cd1
+%if (0%{?with_secrets} == 1)
bb7cd1
 %{_libexecdir}/%{servicename}/sssd_secrets
bb7cd1
+%endif
bb7cd1
 %{_libexecdir}/%{servicename}/sssd_ssh
bb7cd1
 %{_libexecdir}/%{servicename}/sssd_sudo
bb7cd1
 %{_libexecdir}/%{servicename}/p11_child
bb7cd1
@@ -900,7 +911,9 @@ done
bb7cd1
 %dir %{_localstatedir}/cache/krb5rcache
bb7cd1
 %attr(700,sssd,sssd) %dir %{dbpath}
bb7cd1
 %attr(755,sssd,sssd) %dir %{mcpath}
bb7cd1
+%if (0%{?with_secrets} == 1)
bb7cd1
 %attr(700,root,root) %dir %{secdbpath}
bb7cd1
+%endif
bb7cd1
 %ghost %attr(0644,sssd,sssd) %verify(not md5 size mtime) %{mcpath}/passwd
bb7cd1
 %ghost %attr(0644,sssd,sssd) %verify(not md5 size mtime) %{mcpath}/group
bb7cd1
 %ghost %attr(0644,sssd,sssd) %verify(not md5 size mtime) %{mcpath}/initgroups
bb7cd1
@@ -933,7 +946,9 @@ done
bb7cd1
 %{_mandir}/man5/sssd.conf.5*
bb7cd1
 %{_mandir}/man5/sssd-simple.5*
bb7cd1
 %{_mandir}/man5/sssd-sudo.5*
bb7cd1
+%if (0%{?with_secrets} == 1)
bb7cd1
 %{_mandir}/man5/sssd-secrets.5*
bb7cd1
+%endif
bb7cd1
 %{_mandir}/man5/sss_rpcidmapd.5*
bb7cd1
 %{_mandir}/man8/sssd.8*
bb7cd1
 %{_mandir}/man8/sss_cache.8*
bb7cd1
diff --git a/src/tests/intg/test_secrets.py b/src/tests/intg/test_secrets.py
bb7cd1
index d71c1904558cc6f8a6eee36c4049582705bc30ac..202f43e61cb0e4986394ad2b32da5abdcb0be3e9 100644
bb7cd1
--- a/src/tests/intg/test_secrets.py
bb7cd1
+++ b/src/tests/intg/test_secrets.py
bb7cd1
@@ -46,6 +46,10 @@ def create_sssd_secrets_fixture(request):
bb7cd1
         raise Exception("failed to regenerate confdb")
bb7cd1
 
bb7cd1
     resp_path = os.path.join(config.LIBEXEC_PATH, "sssd", "sssd_secrets")
bb7cd1
+    if not os.access(resp_path, os.X_OK):
bb7cd1
+        # It would be cleaner to use pytest.mark.skipif on the package level
bb7cd1
+        # but upstream insists on supporting RHEL-6.
bb7cd1
+        pytest.skip("No Secrets responder, skipping")
bb7cd1
 
bb7cd1
     secpid = os.fork()
bb7cd1
     assert secpid >= 0
bb7cd1
-- 
bb7cd1
2.9.3
bb7cd1