2006-12-14 11:23:51 +00:00
|
|
|
Summary: Allows restricted root access for specified users
|
2004-09-09 12:46:21 +00:00
|
|
|
Name: sudo
|
2021-10-03 19:51:02 +00:00
|
|
|
Version: 1.9.8p2
|
2021-08-25 15:03:18 +00:00
|
|
|
Release: %autorelease
|
2010-09-07 14:28:31 +00:00
|
|
|
License: ISC
|
2020-12-04 00:09:48 +00:00
|
|
|
URL: https://www.sudo.ws
|
|
|
|
Source0: %{url}/dist/%{name}-%{version}.tar.gz
|
2016-05-31 10:22:54 +00:00
|
|
|
Source1: sudoers
|
2017-09-06 16:53:03 +00:00
|
|
|
Requires: pam
|
2021-10-03 20:18:20 +00:00
|
|
|
Recommends: nano
|
2021-01-13 18:51:24 +00:00
|
|
|
Recommends: %{name}-python-plugin%{?_isa} = %{version}-%{release}
|
2006-05-23 14:27:14 +00:00
|
|
|
|
2021-01-08 22:03:13 +00:00
|
|
|
BuildRequires: make
|
2006-05-23 14:27:14 +00:00
|
|
|
BuildRequires: pam-devel
|
|
|
|
BuildRequires: groff
|
|
|
|
BuildRequires: openldap-devel
|
2006-07-16 22:37:37 +00:00
|
|
|
BuildRequires: flex
|
|
|
|
BuildRequires: bison
|
2021-08-05 06:25:56 +00:00
|
|
|
BuildRequires: libtool
|
2007-08-30 16:21:58 +00:00
|
|
|
BuildRequires: audit-libs-devel libcap-devel
|
2008-02-06 13:05:56 +00:00
|
|
|
BuildRequires: libselinux-devel
|
2009-01-13 17:09:02 +00:00
|
|
|
BuildRequires: sendmail
|
2011-11-10 09:22:56 +00:00
|
|
|
BuildRequires: gettext
|
2013-02-28 12:19:12 +00:00
|
|
|
BuildRequires: zlib-devel
|
2004-09-09 12:53:47 +00:00
|
|
|
|
2005-09-19 18:03:10 +00:00
|
|
|
# don't strip
|
2007-08-20 12:11:21 +00:00
|
|
|
Patch1: sudo-1.6.7p5-strip.patch
|
2004-09-09 12:46:21 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Sudo (superuser do) allows a system administrator to give certain
|
|
|
|
users (or groups of users) the ability to run some (or all) commands
|
|
|
|
as root while logging all commands and arguments. Sudo operates on a
|
|
|
|
per-command basis. It is not a replacement for the shell. Features
|
|
|
|
include: the ability to restrict what commands a user may run on a
|
|
|
|
per-host basis, copious logging of each command (providing a clear
|
|
|
|
audit trail of who did what), a configurable timeout of the sudo
|
|
|
|
command, and the ability to use the same configuration file (sudoers)
|
|
|
|
on many different machines.
|
|
|
|
|
2011-07-12 11:20:39 +00:00
|
|
|
%package devel
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
The %{name}-devel package contains header files developing sudo
|
|
|
|
plugins that use %{name}.
|
|
|
|
|
2020-09-15 14:49:29 +00:00
|
|
|
|
|
|
|
%package logsrvd
|
|
|
|
Summary: High-performance log server for %{name}
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
|
|
|
|
|
|
|
|
%description logsrvd
|
|
|
|
%{name}-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.
|
|
|
|
|
2021-01-13 18:51:24 +00:00
|
|
|
%package python-plugin
|
|
|
|
Summary: Python plugin for %{name}
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
|
|
|
|
|
|
|
%description python-plugin
|
|
|
|
%{name}-python-plugin allows using sudo plugins written in Python.
|
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
%prep
|
2020-07-10 07:44:22 +00:00
|
|
|
%setup -q
|
2010-09-07 14:28:31 +00:00
|
|
|
|
2007-08-20 12:11:21 +00:00
|
|
|
%patch1 -p1 -b .strip
|
2011-09-07 08:48:26 +00:00
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
%build
|
2014-03-12 11:29:34 +00:00
|
|
|
# Remove bundled copy of zlib
|
|
|
|
rm -rf zlib/
|
2008-06-18 09:52:34 +00:00
|
|
|
|
2008-02-04 08:30:14 +00:00
|
|
|
%ifarch s390 s390x sparc64
|
2004-09-09 12:53:47 +00:00
|
|
|
F_PIE=-fPIE
|
|
|
|
%else
|
|
|
|
F_PIE=-fpie
|
|
|
|
%endif
|
|
|
|
|
2011-06-03 13:01:00 +00:00
|
|
|
export CFLAGS="$RPM_OPT_FLAGS $F_PIE" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
|
2004-09-09 12:53:47 +00:00
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
%configure \
|
2007-02-26 19:23:08 +00:00
|
|
|
--prefix=%{_prefix} \
|
|
|
|
--sbindir=%{_sbindir} \
|
|
|
|
--libdir=%{_libdir} \
|
2013-09-30 22:09:16 +00:00
|
|
|
--docdir=%{_pkgdocdir} \
|
2020-09-15 14:49:29 +00:00
|
|
|
--enable-openssl \
|
2016-08-26 12:05:06 +00:00
|
|
|
--disable-root-mailer \
|
2007-02-26 19:23:08 +00:00
|
|
|
--with-logging=syslog \
|
|
|
|
--with-logfac=authpriv \
|
|
|
|
--with-pam \
|
2013-02-28 12:19:12 +00:00
|
|
|
--with-pam-login \
|
2021-10-03 20:18:20 +00:00
|
|
|
--with-editor=%{_bindir}/nano:%{_bindir}/vim:%{_bindir}/vi \
|
2007-02-26 19:23:08 +00:00
|
|
|
--with-env-editor \
|
|
|
|
--with-ignore-dot \
|
|
|
|
--with-tty-tickets \
|
2008-02-21 15:10:42 +00:00
|
|
|
--with-ldap \
|
2013-02-28 12:19:12 +00:00
|
|
|
--with-selinux \
|
|
|
|
--with-passprompt="[sudo] password for %p: " \
|
2020-10-05 11:34:24 +00:00
|
|
|
--enable-python \
|
2021-08-05 06:25:56 +00:00
|
|
|
--enable-zlib=system \
|
2013-02-28 12:19:12 +00:00
|
|
|
--with-linux-audit \
|
|
|
|
--with-sssd
|
|
|
|
# --without-kerb5 \
|
|
|
|
# --without-kerb4
|
2004-09-09 12:46:21 +00:00
|
|
|
make
|
|
|
|
|
2015-08-24 12:14:56 +00:00
|
|
|
%check
|
|
|
|
make check
|
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2005-04-12 12:19:47 +00:00
|
|
|
make install DESTDIR="$RPM_BUILD_ROOT" install_uid=`id -u` install_gid=`id -g` sudoers_uid=`id -u` sudoers_gid=`id -g`
|
2011-11-10 09:22:56 +00:00
|
|
|
|
2020-03-26 10:53:05 +00:00
|
|
|
chmod 755 $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_sbindir}/*
|
2010-09-20 06:38:07 +00:00
|
|
|
install -p -d -m 700 $RPM_BUILD_ROOT/var/db/sudo
|
2016-06-24 14:22:57 +00:00
|
|
|
install -p -d -m 700 $RPM_BUILD_ROOT/var/db/sudo/lectured
|
2010-01-12 13:17:31 +00:00
|
|
|
install -p -d -m 750 $RPM_BUILD_ROOT/etc/sudoers.d
|
2007-02-26 19:23:08 +00:00
|
|
|
install -p -c -m 0440 %{SOURCE1} $RPM_BUILD_ROOT/etc/sudoers
|
2017-04-07 14:01:56 +00:00
|
|
|
#add sudo to protected packages
|
2018-09-10 11:08:04 +00:00
|
|
|
install -p -d -m 755 $RPM_BUILD_ROOT/etc/dnf/protected.d/
|
2017-04-07 14:01:56 +00:00
|
|
|
touch sudo.conf
|
|
|
|
echo sudo > sudo.conf
|
2018-09-10 11:08:04 +00:00
|
|
|
install -p -c -m 0644 sudo.conf $RPM_BUILD_ROOT/etc/dnf/protected.d/
|
2017-04-07 14:01:56 +00:00
|
|
|
rm -f sudo.conf
|
2004-09-09 12:46:21 +00:00
|
|
|
|
2013-09-30 22:09:16 +00:00
|
|
|
chmod +x $RPM_BUILD_ROOT%{_libexecdir}/sudo/*.so # for stripping, reset in %%files
|
2013-02-28 12:19:12 +00:00
|
|
|
|
2014-08-05 15:04:25 +00:00
|
|
|
# Don't package LICENSE as a doc
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_pkgdocdir}/LICENSE
|
|
|
|
|
2015-02-18 09:32:39 +00:00
|
|
|
# Remove examples; Examples can be found in man pages too.
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/examples/sudo
|
|
|
|
|
2015-07-10 13:28:28 +00:00
|
|
|
#Remove all .la files
|
|
|
|
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
|
|
|
|
2017-05-31 07:05:44 +00:00
|
|
|
# Remove sudoers.dist
|
|
|
|
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.dist
|
|
|
|
|
2011-11-10 09:22:56 +00:00
|
|
|
%find_lang sudo
|
|
|
|
%find_lang sudoers
|
|
|
|
|
|
|
|
cat sudo.lang sudoers.lang > sudo_all.lang
|
|
|
|
rm sudo.lang sudoers.lang
|
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
|
|
|
|
cat > $RPM_BUILD_ROOT/etc/pam.d/sudo << EOF
|
2013-02-28 12:19:12 +00:00
|
|
|
#%%PAM-1.0
|
2007-02-26 19:23:08 +00:00
|
|
|
auth include system-auth
|
|
|
|
account include system-auth
|
|
|
|
password include system-auth
|
|
|
|
session optional pam_keyinit.so revoke
|
|
|
|
session required pam_limits.so
|
2014-09-30 13:45:25 +00:00
|
|
|
session include system-auth
|
2006-07-16 22:37:37 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > $RPM_BUILD_ROOT/etc/pam.d/sudo-i << EOF
|
2013-02-28 12:19:12 +00:00
|
|
|
#%%PAM-1.0
|
2007-02-26 19:23:08 +00:00
|
|
|
auth include sudo
|
|
|
|
account include sudo
|
|
|
|
password include sudo
|
|
|
|
session optional pam_keyinit.so force revoke
|
2014-09-30 13:45:25 +00:00
|
|
|
session include sudo
|
2004-09-09 12:46:21 +00:00
|
|
|
EOF
|
2004-09-09 12:51:15 +00:00
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
|
2011-11-10 09:22:56 +00:00
|
|
|
%files -f sudo_all.lang
|
2020-07-10 07:44:22 +00:00
|
|
|
%defattr(-,root,root)
|
2004-09-09 12:47:27 +00:00
|
|
|
%attr(0440,root,root) %config(noreplace) /etc/sudoers
|
2010-01-12 13:17:31 +00:00
|
|
|
%attr(0750,root,root) %dir /etc/sudoers.d/
|
2004-09-09 12:46:21 +00:00
|
|
|
%config(noreplace) /etc/pam.d/sudo
|
2006-07-16 22:37:37 +00:00
|
|
|
%config(noreplace) /etc/pam.d/sudo-i
|
2015-07-10 13:28:28 +00:00
|
|
|
%attr(0644,root,root) %{_tmpfilesdir}/sudo.conf
|
2020-07-10 07:44:22 +00:00
|
|
|
%attr(0644,root,root) %config(noreplace) /etc/dnf/protected.d/sudo.conf
|
|
|
|
%attr(0640,root,root) %config(noreplace) /etc/sudo.conf
|
2010-09-07 14:49:47 +00:00
|
|
|
%dir /var/db/sudo
|
2016-06-24 14:22:57 +00:00
|
|
|
%dir /var/db/sudo/lectured
|
2004-09-09 12:46:21 +00:00
|
|
|
%attr(4111,root,root) %{_bindir}/sudo
|
2015-07-10 13:28:28 +00:00
|
|
|
%{_bindir}/sudoedit
|
2010-09-07 14:28:31 +00:00
|
|
|
%attr(0111,root,root) %{_bindir}/sudoreplay
|
2004-09-09 12:46:21 +00:00
|
|
|
%attr(0755,root,root) %{_sbindir}/visudo
|
2018-04-18 10:54:42 +00:00
|
|
|
%{_bindir}/cvtsudoers
|
2014-01-25 18:15:33 +00:00
|
|
|
%dir %{_libexecdir}/sudo
|
2013-09-30 22:09:16 +00:00
|
|
|
%attr(0755,root,root) %{_libexecdir}/sudo/sesh
|
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/sudo_noexec.so
|
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/sudoers.so
|
2020-03-25 15:47:47 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/audit_json.so
|
2013-09-30 22:09:16 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/group_file.so
|
2020-03-25 15:47:47 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/sample_approval.so
|
2013-09-30 22:09:16 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/system_group.so
|
2021-10-03 19:51:02 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/sudo_intercept.so
|
2015-07-10 13:28:28 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/libsudo_util.so.?.?.?
|
|
|
|
%{_libexecdir}/sudo/libsudo_util.so.?
|
2017-09-29 13:43:08 +00:00
|
|
|
%{_libexecdir}/sudo/libsudo_util.so
|
2004-09-09 12:46:21 +00:00
|
|
|
%{_mandir}/man5/sudoers.5*
|
2010-04-14 13:49:58 +00:00
|
|
|
%{_mandir}/man5/sudoers.ldap.5*
|
2013-09-30 22:09:16 +00:00
|
|
|
%{_mandir}/man5/sudo.conf.5*
|
2004-09-09 12:46:21 +00:00
|
|
|
%{_mandir}/man8/sudo.8*
|
2005-04-12 12:19:47 +00:00
|
|
|
%{_mandir}/man8/sudoedit.8*
|
2010-09-07 14:28:31 +00:00
|
|
|
%{_mandir}/man8/sudoreplay.8*
|
2004-09-09 12:46:21 +00:00
|
|
|
%{_mandir}/man8/visudo.8*
|
2018-04-18 10:54:42 +00:00
|
|
|
%{_mandir}/man1/cvtsudoers.1.gz
|
|
|
|
%{_mandir}/man5/sudoers_timestamp.5.gz
|
2013-09-30 22:09:16 +00:00
|
|
|
%dir %{_pkgdocdir}/
|
|
|
|
%{_pkgdocdir}/*
|
2014-08-05 15:04:25 +00:00
|
|
|
%{!?_licensedir:%global license %%doc}
|
|
|
|
%license doc/LICENSE
|
2014-05-31 23:24:08 +00:00
|
|
|
%exclude %{_pkgdocdir}/ChangeLog
|
2004-09-09 12:46:21 +00:00
|
|
|
|
2011-07-12 11:20:39 +00:00
|
|
|
%files devel
|
2012-11-12 12:16:34 +00:00
|
|
|
%doc plugins/sample/sample_plugin.c
|
2011-07-12 11:20:39 +00:00
|
|
|
%{_includedir}/sudo_plugin.h
|
|
|
|
%{_mandir}/man8/sudo_plugin.8*
|
|
|
|
|
2020-09-15 14:49:29 +00:00
|
|
|
%files logsrvd
|
|
|
|
%attr(0640,root,root) %config(noreplace) /etc/sudo_logsrvd.conf
|
|
|
|
%attr(0755,root,root) %{_sbindir}/sudo_logsrvd
|
|
|
|
%attr(0755,root,root) %{_sbindir}/sudo_sendlog
|
|
|
|
%{_mandir}/man5/sudo_logsrv.proto.5.gz
|
|
|
|
%{_mandir}/man5/sudo_logsrvd.conf.5.gz
|
|
|
|
%{_mandir}/man8/sudo_logsrvd.8.gz
|
|
|
|
%{_mandir}/man8/sudo_sendlog.8.gz
|
|
|
|
|
2021-01-13 18:51:24 +00:00
|
|
|
%files python-plugin
|
|
|
|
%{_mandir}/man8/sudo_plugin_python.8.gz
|
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/python_plugin.so
|
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
%changelog
|
2021-08-25 15:03:18 +00:00
|
|
|
%autochangelog
|