2021-10-06 15:15:52 +00:00
|
|
|
# comment out if no extra version
|
2024-01-24 09:59:51 +00:00
|
|
|
%global extraver p5
|
2021-10-06 15:15:52 +00:00
|
|
|
|
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
|
2024-01-24 09:59:51 +00:00
|
|
|
Version: 1.9.15
|
2021-10-06 15:15:52 +00:00
|
|
|
# remove -b 3 after rebase !!!
|
|
|
|
# use "-p -e % {?extraver}" when beta
|
|
|
|
# use "-e % {?extraver}"" when patch version
|
|
|
|
# use nothing special when normal version
|
2023-01-19 13:19:32 +00:00
|
|
|
Release: %autorelease -e %{?extraver}
|
2010-09-07 14:28:31 +00:00
|
|
|
License: ISC
|
2020-12-04 00:09:48 +00:00
|
|
|
URL: https://www.sudo.ws
|
2021-10-06 15:15:52 +00:00
|
|
|
Source0: %{url}/dist/%{name}-%{version}%{?extraver}.tar.gz
|
2016-05-31 10:22:54 +00:00
|
|
|
Source1: sudoers
|
2024-08-19 05:21:14 +00:00
|
|
|
Source2: sudo-ldap.conf
|
2017-09-06 16:53:03 +00:00
|
|
|
Requires: pam
|
2022-06-06 16:54:31 +00:00
|
|
|
Recommends: system-default-editor
|
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
|
2024-02-08 21:46:56 +00:00
|
|
|
BuildRequires: systemd-rpm-macros
|
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
|
|
|
|
2024-08-19 05:21:14 +00:00
|
|
|
|
|
|
|
Patch1: coverity.patch
|
2024-08-21 08:35:32 +00:00
|
|
|
Patch2: sudo-conf.patch
|
2024-08-19 05:21:14 +00:00
|
|
|
|
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}.
|
|
|
|
|
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
|
2023-04-26 09:41:20 +00:00
|
|
|
%autosetup -p1 -n %{name}-%{version}%{?extraver}
|
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
|
|
|
|
2024-08-19 05:21:14 +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} \
|
2024-02-08 21:46:56 +00:00
|
|
|
--enable-tmpfiles.d=%{_tmpfilesdir} \
|
2024-08-19 05:21:14 +00:00
|
|
|
--disable-openssl \
|
2016-08-26 12:05:06 +00:00
|
|
|
--disable-root-mailer \
|
2024-08-19 05:21:14 +00:00
|
|
|
--enable-intercept \
|
|
|
|
--disable-log-server \
|
|
|
|
--disable-log-client \
|
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 \
|
2024-08-19 05:21:14 +00:00
|
|
|
--with-editor=/usr/bin/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 \
|
2024-08-19 05:21:14 +00:00
|
|
|
--with-ldap-conf-file="%{_sysconfdir}/sudo-ldap.conf" \
|
2013-02-28 12:19:12 +00:00
|
|
|
--with-selinux \
|
2024-02-08 21:46:56 +00:00
|
|
|
--with-sendmail=/usr/sbin/sendmail \
|
2013-02-28 12:19:12 +00:00
|
|
|
--with-passprompt="[sudo] password for %p: " \
|
2023-01-19 13:19:32 +00:00
|
|
|
--enable-python \
|
|
|
|
--enable-zlib=system \
|
2013-02-28 12:19:12 +00:00
|
|
|
--with-linux-audit \
|
|
|
|
--with-sssd
|
2024-08-19 05:21:14 +00:00
|
|
|
|
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
|
2024-08-19 05:21:14 +00:00
|
|
|
|
|
|
|
# Update README.LDAP (#736653)
|
|
|
|
sed -i 's|/etc/ldap\.conf|%{_sysconfdir}/sudo-ldap.conf|g' README.LDAP.md
|
|
|
|
|
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
|
2024-08-19 05:21:14 +00:00
|
|
|
install -p -c -m 0640 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/sudo-ldap.conf
|
|
|
|
|
|
|
|
# create sudo-ldap.conf man
|
|
|
|
echo ".so man5/sudoers.ldap.5" > sudo-ldap.conf.5
|
|
|
|
gzip sudo-ldap.conf.5
|
|
|
|
install -p -c -m 0644 sudo-ldap.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/sudo-ldap.conf.5.gz
|
|
|
|
rm -f sudo-ldap.conf.5.gz
|
|
|
|
|
|
|
|
# we are not building sendlog so we don't need this
|
|
|
|
rm -rf $RPM_BUILD_ROOT/%{_mandir}/man8/sudo_sendlog.8
|
|
|
|
|
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
|
|
|
|
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
|
2024-08-21 08:35:32 +00:00
|
|
|
|
2004-09-09 12:46:21 +00:00
|
|
|
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
|
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
|
|
|
|
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
|
2024-08-19 05:21:14 +00:00
|
|
|
%attr(0640,root,root) %config(noreplace) /etc/sudo.conf
|
|
|
|
%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/sudo-ldap.conf
|
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
|
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
|
2024-08-19 05:21:14 +00:00
|
|
|
%{_bindir}/cvtsudoers
|
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
|
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
|
2020-03-25 15:47:47 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/audit_json.so
|
2024-08-19 05:21:14 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/sudoers.so
|
2013-09-30 22:09:16 +00:00
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/group_file.so
|
|
|
|
%attr(0644,root,root) %{_libexecdir}/sudo/system_group.so
|
2024-08-19 05:21:14 +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*
|
2024-08-19 05:21:14 +00:00
|
|
|
%{_mandir}/man5/sudo-ldap.conf.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*
|
2024-08-19 05:21:14 +00:00
|
|
|
%{_mandir}/man1/cvtsudoers.1*
|
|
|
|
%{_mandir}/man5/sudoers_timestamp.5*
|
2013-09-30 22:09:16 +00:00
|
|
|
%dir %{_pkgdocdir}/
|
|
|
|
%{_pkgdocdir}/*
|
2014-08-05 15:04:25 +00:00
|
|
|
%{!?_licensedir:%global license %%doc}
|
2022-06-22 13:57:57 +00:00
|
|
|
%license LICENSE.md
|
2014-05-31 23:24:08 +00:00
|
|
|
%exclude %{_pkgdocdir}/ChangeLog
|
2004-09-09 12:46:21 +00:00
|
|
|
|
2024-08-19 05:21:14 +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
|
2022-06-22 13:57:57 +00:00
|
|
|
%{_mandir}/man5/sudo_plugin.5*
|
2011-07-12 11:20:39 +00:00
|
|
|
|
2021-01-13 18:51:24 +00:00
|
|
|
%files python-plugin
|
2022-06-22 13:57:57 +00:00
|
|
|
%{_mandir}/man5/sudo_plugin_python.5.gz
|
2021-01-13 18:51:24 +00:00
|
|
|
%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
|