#
# Conditional build:
-%bcond_with kerberos5 # enable Kerberos V support (conflicts with PAM)
-%bcond_without ldap # disable LDAP support
-%bcond_without pam # disable PAM support
-%bcond_without selinux # build without SELinux support
-%bcond_with skey # enable skey (onetime passwords) support (conflicts with PAM)
+%if "%{pld_release}" == "ac"
+%bcond_with audit # Linux audit support
+%else
+%bcond_without audit # Linux audit support
+%endif
+%bcond_with kerberos5 # Kerberos V support (conflicts with PAM)
+%bcond_without ldap # LDAP support
+%bcond_without pam # PAM support
+%bcond_without selinux # SELinux support
+%bcond_with skey # skey (onetime passwords) support (conflicts with PAM)
+%bcond_without sssd # SSSD support plugin
+%bcond_without tests # do not perform "make check"
%if "%{pld_release}" == "ac"
%define pam_ver 0.80.1
Summary(ru.UTF-8): Позволяет определенным пользователям исполнять команды от имени root
Summary(uk.UTF-8): Дозволяє вказаним користувачам виконувати команди від імені root
Name: sudo
-Version: 1.7.4p3
-Release: 2
+# please see doc/UPGRADE for important changes each time updating sudo
+Version: 1.9.5p2
+Release: 1
Epoch: 1
License: BSD
Group: Applications/System
Source0: ftp://ftp.sudo.ws/pub/sudo/%{name}-%{version}.tar.gz
-# Source0-md5: 950994a454a3eb7a74df5f4bc863bd2b
+# Source0-md5: e6bc4c18c06346e6b3431637a2b5f3d5
Source1: %{name}.pamd
Source2: %{name}-i.pamd
-Source3: %{name}.logrotate
-Patch0: %{name}-libtool.patch
-Patch1: %{name}-env.patch
+Patch0: %{name}-env.patch
+Patch1: config.patch
+Patch2: %{name}-sh.patch
URL: http://www.sudo.ws/sudo/
+%{?with_audit:BuildRequires: audit-libs-devel}
BuildRequires: autoconf >= 2.53
+BuildRequires: autoconf-archive
BuildRequires: automake
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: gettext-devel
+BuildRequires: groff
%{?with_kerberos5:BuildRequires: heimdal-devel}
%{?with_selinux:BuildRequires: libselinux-devel}
BuildRequires: libtool >= 2:2.2.6
%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
%{?with_pam:BuildRequires: pam-devel}
BuildRequires: rpm >= 4.4.9-56
-BuildRequires: rpmbuild(macros) >= 1.402
+BuildRequires: rpmbuild(macros) >= 1.752
%{?with_skey:BuildRequires: skey-devel >= 2.2-11}
+BuildRequires: zlib-devel
+%if "%{pld_release}" != "ac"
+# uses /run
+Requires: FHS >= 3.0
+%endif
Requires: pam >= %{pam_ver}
Obsoletes: cu-sudo
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define schemadir /usr/share/openldap/schema
+# uses sudo_warn_*_v1 symbols from binaries
+%define skip_post_check_so libsudo_util.so.*
+
%description
Sudo (superuser do) allows a permitted user to execute a command as
the superuser (real and effective uid and gid are set to 0 and root's
пам'ятає пароль; використання одного конфігураційного файлу (sudoers)
на багатьох машинах.
+%package devel
+Summary: Header file for sudo plugins development
+Summary(pl.UTF-8): Plik nagłówkowy do tworzenia wtyczek dla sudo
+Group: Development/Libraries
+
+%description devel
+Header file for sudo plugins development.
+
+%description devel -l pl.UTF-8
+Plik nagłówkowy do tworzenia wtyczek dla sudo.
+
%package -n openldap-schema-sudo
Summary: Sudo LDAP schema
Summary(pl.UTF-8): Schemat bazy sudo dla LDAP
Requires(post,postun): sed >= 4.0
Requires: openldap-servers
Requires: sed >= 4.0
+%{?noarchpackage}
%description -n openldap-schema-sudo
This package contains sudo.schema for openldap.
%description -n openldap-schema-sudo -l pl.UTF-8
Ten pakiet zawiera sudo.schema dla pakietu openldap.
+%package logsrvd
+Summary: High-performance log server for sudo
+Summary(pl.UTF-8): Wysoko wydajny serwer logujący dla sudo
+Group: Daemons
+Requires: %{name} = %{epoch}:%{version}-%{release}
+
+%description logsrvd
+sudo-logsrvd is a high-performance log server that accepts event
+and I/O logs from sudo. It can be used to implement centralized
+logging of sudo logs.
+
+%description logsrvd -l pl.UTF-8
+sudo-logsrvd to wysoko wydajny serwer logujący przyjmyjący logi
+zdarzeń i we/wy z sudo. Może byc używany do zaimplementowania
+scentralizowanego logowania z sudo.
+
%prep
%setup -q
# only local macros
-mv -f aclocal.m4 acinclude.m4
-# kill libtool.m4 copy
-rm -f acsite.m4
+%{__mv} aclocal.m4 acinclude.m4
# do not load libtool macros from acinclude
+cp -p acinclude.m4 acinclude.m4.orig
%{__sed} -i -e '/Pull in libtool macros/,$d' acinclude.m4
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+
+! [ -f m4/ax_sys_weak_alias.m4 ] # provide own copy only until it is there
+cp %{_aclocaldir}/ax_sys_weak_alias.m4 m4
%build
%{__mv} install-sh install-custom-sh
%{__libtoolize}
%{__mv} install-custom-sh install-sh
cp -f /usr/share/automake/config.sub .
-%{__aclocal}
+%{__aclocal} -I m4
%{__autoconf}
%configure \
NROFFPROG=nroff \
+ --enable-zlib=system \
+ --with-env-editor \
+ --with-ignore-dot \
--with-incpath=/usr/include/security \
- --with-timedir=/var/run/sudo \
+ --with-logfac=authpriv \
+ --with-logging=syslog \
+ --with-loglen=320 \
+ --with-logpath=/var/log/sudo \
+ --with-long-otp-prompt \
--with-pam \
--with-pam-login \
- --with-logging=both \
- --with-logfac=auth \
- --with-logpath=/var/log/sudo \
- --with-ignore-dot \
- --with-env-editor \
+ --with-passprompt="[sudo] password for %%p: " \
--with-secure-path="/bin:/sbin:/usr/bin:/usr/sbin" \
- --with-loglen=320 \
- --with%{!?with_kerberos5:out}-kerb5 \
- --with%{!?with_ldap:out}-ldap \
- --with%{!?with_skey:out}-skey \
- --with%{!?with_selinux:out}-selinux \
- --with-long-otp-prompt
+ --with-tty-tickets \
+ --with-exampledir=%{_examplesdir}/%{name}-%{version} \
+ --enable-tmpfiles.d=%{systemdtmpfilesdir} \
+ %{__with kerberos5 kerb5} \
+ %{__with ldap} \
+ %{__with audit linux-audit} \
+ %{__with selinux} \
+ %{__with skey} \
+ %{__with sssd} \
%{__make}
+%{?with_tests:%{__make} check}
+
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{sudoers.d,pam.d,logrotate.d},/var/{log,run/sudo},%{_mandir}/man8}
-
-# makefile broken?
-touch .libs/sudo_noexec.so
+install -d $RPM_BUILD_ROOT{/etc/pam.d,/var/log/sudo-io}
%{__make} -j1 install \
DESTDIR=$RPM_BUILD_ROOT \
install_uid=$(id -u) \
install_gid=$(id -g) \
sudoers_uid=$(id -u) \
- sudoers_gid=$(id -g)
+ sudoers_gid=$(id -g) \
+ shlib_mode="0755"
-cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo
-cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
-touch $RPM_BUILD_ROOT/var/log/sudo
-cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/sudo
+%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.dist
-chmod -R +r $RPM_BUILD_ROOT%{_prefix}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
-rm -f $RPM_BUILD_ROOT%{_libdir}/sudo_noexec.la
-rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
+%if "%{pld_release}" == "ac"
+# not present in ac, no point searching it
+%{__sed} -i -e '/pam_keyinit.so/d' $RPM_BUILD_ROOT/etc/pam.d/sudo*
+%endif
+
+%{__rm} $RPM_BUILD_ROOT%{_libexecdir}/sudo/*.la
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
%if %{with ldap}
install -d $RPM_BUILD_ROOT%{schemadir}
-cp -a schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema
+cp -p doc/schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema
%endif
+# sudo,sudoers domains
+%find_lang %{name} --all-name
+
%clean
rm -rf $RPM_BUILD_ROOT
%post -n openldap-schema-sudo
%openldap_schema_register %{schemadir}/sudo.schema -d core
%service -q ldap restart
-
-# banner on first install
-if [ "$1" = "1" ]; then
-%banner -e openldap-schema-sudo <<'EOF'
+%banner -o -e openldap-schema-sudo <<'EOF'
NOTE:
In order for sudoRole LDAP queries to be efficient, the server must index
the attribute 'sudoUser', e.g.
# Indices to maintain
index sudoUser eq
EOF
-fi
%postun -n openldap-schema-sudo
if [ "$1" = "0" ]; then
%service -q ldap restart
fi
-%files
+%triggerpostun -- %{name} < 1:1.8.7-2
+# 1:1.8.7-2
+# add include statement to sudoers
+if ! grep -q '#includedir %{_sysconfdir}/sudoers.d' /etc/sudoers; then
+ echo 'Adding includedir %{_sysconfdir}/sudoers.d to /etc/sudoers'
+ cat <<-EOF >> /etc/sudoers
+ ## Read drop-in files from %{_sysconfdir}/sudoers.d
+ ## (the '#' here does not indicate a comment)
+ #includedir %{_sysconfdir}/sudoers.d
+ EOF
+fi
+
+%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc ChangeLog HISTORY NEWS README TROUBLESHOOTING UPGRADE sample.*
-%{?with_ldap:%doc README.LDAP sudoers2ldif}
+%doc ChangeLog NEWS README doc/{CONTRIBUTORS,HISTORY,LICENSE,TROUBLESHOOTING,UPGRADE}
+%{?with_ldap:%doc README.LDAP}
%attr(550,root,root) %dir %{_sysconfdir}/sudoers.d
%attr(440,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudoers
+%attr(640,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudo.conf
%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo
%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo-i
+%attr(755,root,root) %{_bindir}/cvtsudoers
%attr(4755,root,root) %{_bindir}/sudo
%attr(4755,root,root) %{_bindir}/sudoedit
%attr(755,root,root) %{_bindir}/sudoreplay
%attr(755,root,root) %{_sbindir}/visudo
-%{?with_selinux:%attr(755,root,root) %{_libdir}/sesh}
-%attr(755,root,root) %{_libdir}/sudo_noexec.so
+%dir %{_libexecdir}/sudo
+%attr(755,root,root) %{_libexecdir}/sudo/libsudo_util.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/sudo/libsudo_util.so.0
+%attr(755,root,root) %{_libexecdir}/sudo/libsudo_util.so
+%{?with_selinux:%attr(755,root,root) %{_libexecdir}/sudo/sesh}
+%attr(755,root,root) %{_libexecdir}/sudo/audit_json.so
+%attr(755,root,root) %{_libexecdir}/sudo/group_file.so
+%attr(755,root,root) %{_libexecdir}/sudo/sample_approval.so
+%attr(755,root,root) %{_libexecdir}/sudo/sudo_noexec.so
+%attr(755,root,root) %{_libexecdir}/sudo/sudoers.so
+%attr(755,root,root) %{_libexecdir}/sudo/system_group.so
+%{_mandir}/man1/cvtsudoers.1*
%{_mandir}/man5/sudoers.5*
+%{_mandir}/man5/sudoers_timestamp.5*
+%{_mandir}/man5/sudo.conf.5*
%{?with_ldap:%{_mandir}/man5/sudoers.ldap.5*}
%{_mandir}/man8/sudo.8*
+%{_mandir}/man8/sudo_plugin.8*
%{_mandir}/man8/sudoedit.8*
%{_mandir}/man8/sudoreplay.8*
%{_mandir}/man8/visudo.8*
-%attr(600,root,root) %ghost /var/log/sudo
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/sudo
-%attr(700,root,root) %dir /var/run/sudo
+%{systemdtmpfilesdir}/%{name}.conf
+%{_examplesdir}/%{name}-%{version}
+%attr(700,root,root) /var/log/sudo-io
+%attr(700,root,root) %dir /var/db/sudo
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/sudo_plugin.h
+%if %{with ldap}
%files -n openldap-schema-sudo
%defattr(644,root,root,755)
%{schemadir}/sudo.schema
+%endif
+
+%files logsrvd
+%defattr(644,root,root,755)
+%attr(640,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudo_logsrvd.conf
+%attr(755,root,root) %{_sbindir}/sudo_logsrvd
+%attr(755,root,root) %{_sbindir}/sudo_sendlog
+%{_mandir}/man5/sudo_logsrv.proto.5*
+%{_mandir}/man5/sudo_logsrvd.conf.5*
+%{_mandir}/man8/sudo_logsrvd.8*
+%{_mandir}/man8/sudo_sendlog.8*