Accepting request 215868 from home:vitezslav_cizek:branches:Base:System
- added subpackage with a test for fate#313276 OBS-URL: https://build.opensuse.org/request/show/215868 OBS-URL: https://build.opensuse.org/package/show/Base:System/sudo?expand=0&rev=69
This commit is contained in:
parent
9d9232ee84
commit
2e20424a47
19
README_313276.test
Normal file
19
README_313276.test
Normal file
@ -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.
|
||||
|
14
fate_313276_test.sh
Normal file
14
fate_313276_test.sh
Normal file
@ -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
|
@ -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
|
||||
|
||||
|
24
sudo.spec
24
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user