diff --git a/README_313276.test b/README_313276.test new file mode 100644 index 0000000..83fddc2 --- /dev/null +++ b/README_313276.test @@ -0,0 +1,19 @@ +To verify that sudo works with SSSD, +there's has to be a working LDAP server where the sudoers file +will be saved, local running SSSD and sudo configured to use +the SSSD plugin. + +The sudoers file has to be stored in LDAP. +A [sudo] service has to be configured in /etc/sssd/sssd.conf +Sudo needs to be instructed to use SSSD, this is done in /etc/nsswitch.conf, +by adding a line "sudoers: files sss" + +Related material: + +/usr/share/doc/packages/sudo/README.LDAP provides a guide how to +make sudo work with LDAP. + +man sudoers.ldap(5) describes the LDAP-based sudoers file + +man sssd-ldap(5) describes the LDAP sudo options. + diff --git a/fate_313276_test.sh b/fate_313276_test.sh new file mode 100644 index 0000000..8d48aac --- /dev/null +++ b/fate_313276_test.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +if [ $(id -u) -ne 0 ]; then + printf "Please run the test as root.\n" + exit 1 +fi + +if sudo -V | grep -q -- --with-sssd; then + printf "OK: Sudo has support for SSSD compiled in.\n" + exit 0 +fi + +printf "Error: SSSD support isn't compiled in.\n" +exit 1 diff --git a/sudo.changes b/sudo.changes index 73dae5d..60b3b51 100644 --- a/sudo.changes +++ b/sudo.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 30 12:12:28 UTC 2014 - vcizek@suse.com + +- added subpackage with a test for fate#313276 + ------------------------------------------------------------------- Wed Jan 29 19:47:28 UTC 2014 - vcizek@suse.com diff --git a/sudo.spec b/sudo.spec index 5db9771..5ca36d4 100644 --- a/sudo.spec +++ b/sudo.spec @@ -26,6 +26,8 @@ Url: http://www.sudo.ws/ Source0: http://sudo.ws/sudo/dist/%{name}-%{version}.tar.gz Source1: sudo.pamd Source2: README.SUSE +Source3: fate_313276_test.sh +Source4: README_313276.test Patch0: sudoers2ldif-env.patch # PATCH-OPENSUSE: the "SUSE" branding of the default sudo config Patch1: sudo-sudoers.patch @@ -56,6 +58,14 @@ Group: Development/Libraries/C and C++ %description devel These header files are needed for building of sudo plugins. +%package test +Summary: Tests for the package +Group: Development/Tests +Requires: %{name} = %{version} + +%description test +Tests for fate#313276 + %prep %setup -q %patch0 -p1 @@ -110,6 +120,12 @@ rm -f %{buildroot}%{_libexecdir}/%{name}/sudoers.la %find_lang %{name} %find_lang sudoers cat sudoers.lang >> %{name}.lang +# tests +install -d -m 755 %{buildroot}/var/lib/tests/sudo +install -m 755 %{SOURCE3} %{buildroot}/var/lib/tests/sudo +install -m 755 %{SOURCE4} %{buildroot}/var/lib/tests/sudo +install -d %{buildroot}%{_docdir}/%{name}-test +install -m 755 %{buildroot}%{_docdir}/%{name}/LICENSE %{buildroot}%{_docdir}/%{name}-test/LICENSE %post chmod 0440 %{_sysconfdir}/sudoers @@ -122,9 +138,6 @@ chmod 0440 %{_sysconfdir}/sudoers %verifyscript %verify_permissions -e /usr/bin/sudo -%clean -rm -rf %{buildroot} - %files -f %{name}.lang %defattr(-,root,root) %doc %{_docdir}/%{name} @@ -147,4 +160,9 @@ rm -rf %{buildroot} %defattr(-,root,root) %{_includedir}/sudo_plugin.h +%files test +%defattr(-,root, root) +/var/lib/tests +%{_docdir}/%{name}-test/ + %changelog