sudo/sudo.spec

237 lines
7.1 KiB
RPMSpec
Raw Permalink Normal View History

2019-09-30 11:17:51 -04:00
Name: sudo
2024-01-07 15:59:41 +08:00
Version: 1.9.15p5
Release: 2
2019-09-30 11:17:51 -04:00
Summary: Allows restricted root access for specified users
License: ISC
2023-01-31 20:10:31 +08:00
URL: https://www.sudo.ws
2019-09-30 11:17:51 -04:00
Source0: https://www.sudo.ws/dist/%{name}-%{version}.tar.gz
Source1: sudoers
Source2: sudo
Source3: sudo-i
2023-07-19 21:05:32 +08:00
Patch0: Fix-compilation-error-on-sw64-arch.patch
Patch1: backport-If-user-s-tty-goes-away-tell-monitor-to-revoke-the-t.patch
Patch2: backport-Avoid-using-ioctl-TIOCNOTTY-in-the-monitor.patch
2023-03-10 02:23:52 +00:00
2019-09-30 11:17:51 -04:00
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: pam
Recommends: vim-minimal
Requires(post): coreutils
BuildRequires: pam-devel groff openldap-devel flex bison automake autoconf libtool
BuildRequires: audit-libs-devel libcap-devel libselinux-devel sendmail gettext zlib-devel
2022-02-15 09:30:17 +08:00
BuildRequires: chrpath
2019-09-30 11:17:51 -04:00
%description
Sudo is a program designed to allow a sysadmin to give limited root privileges
2023-01-31 20:10:31 +08:00
to users and log root activity. The basic philosophy is to give as few
2019-09-30 11:17:51 -04:00
privileges as possible but still allow people to get their work done.
%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}.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
2019-09-30 11:17:51 -04:00
%build
autoreconf -I m4 -fv --install
export CFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
%configure \
--prefix=%{_prefix} \
--sbindir=%{_sbindir} \
--libdir=%{_libdir} \
--docdir=%{_pkgdocdir} \
--disable-root-mailer \
2022-02-15 09:30:17 +08:00
--disable-intercept \
--disable-log-server \
--disable-log-client \
2019-09-30 11:17:51 -04:00
--with-logging=syslog \
--with-logfac=authpriv \
--with-pam \
--with-pam-login \
--with-editor=/bin/vi \
--with-env-editor \
--with-ignore-dot \
--with-tty-tickets \
--with-ldap \
--with-selinux \
--with-passprompt="[sudo] password for %p: " \
--with-linux-audit \
--with-sssd
%make_build
%check
make check
%install
rm -rf $RPM_BUILD_ROOT
%make_install install_uid=`id -u` install_gid=`id -g` sudoers_uid=`id -u` sudoers_gid=`id -g`
2023-01-31 20:10:31 +08:00
chmod 755 $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_sbindir}/*
2019-09-30 11:17:51 -04:00
install -p -d -m 700 $RPM_BUILD_ROOT/var/db/sudo
install -p -d -m 700 $RPM_BUILD_ROOT/var/db/sudo/lectured
install -p -d -m 750 $RPM_BUILD_ROOT/etc/sudoers.d
install -p -c -m 0440 %{SOURCE1} $RPM_BUILD_ROOT/etc/sudoers
install -p -d -m 755 $RPM_BUILD_ROOT/etc/dnf/protected.d/
touch sudo.conf
echo sudo > sudo.conf
install -p -c -m 0644 sudo.conf $RPM_BUILD_ROOT/etc/dnf/protected.d/
rm -f sudo.conf
chmod +x $RPM_BUILD_ROOT%{_libexecdir}/sudo/*.so
rm -rf $RPM_BUILD_ROOT%{_pkgdocdir}/LICENSE
rm -rf $RPM_BUILD_ROOT%{_datadir}/examples/sudo
%delete_la
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.dist
%chrpath_delete
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo "/usr/libexec/sudo" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
%find_lang sudo
%find_lang sudoers
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
install -p -c -m 0644 %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo
install -p -c -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
chrpath -d $RPM_BUILD_ROOT/usr/bin/*
chrpath -d $RPM_BUILD_ROOT/usr/sbin/*
chrpath -d $RPM_BUILD_ROOT/usr/libexec/sudo/*
2019-09-30 11:17:51 -04:00
%post
/bin/chmod 0440 /etc/sudoers || :
/sbin/ldconfig || :
%postun -p /sbin/ldconfig
%files -f sudo.lang -f sudoers.lang
%attr(0440,root,root) %config(noreplace) /etc/sudoers
%attr(0750,root,root) %dir /etc/sudoers.d/
%attr(0644,root,root) %{_tmpfilesdir}/sudo.conf
2021-07-07 16:19:45 +08:00
%attr(0644,root,root) %config(noreplace) /etc/dnf/protected.d/sudo.conf
%attr(0640,root,root) %config(noreplace) /etc/sudo.conf
2019-09-30 11:17:51 -04:00
%attr(4111,root,root) %{_bindir}/sudo
%attr(0111,root,root) %{_bindir}/sudoreplay
%{_bindir}/sudoedit
%{_bindir}/cvtsudoers
%attr(0755,root,root) %{_sbindir}/visudo
%attr(0755,root,root) %{_libexecdir}/sudo/sesh
%attr(0644,root,root) %{_libexecdir}/sudo/sudo_noexec.so
%attr(0644,root,root) %{_libexecdir}/sudo/sudoers.so
%attr(0644,root,root) %{_libexecdir}/sudo/group_file.so
%attr(0644,root,root) %{_libexecdir}/sudo/system_group.so
2020-07-28 19:44:17 +08:00
%attr(0644,root,root) %{_libexecdir}/sudo/audit_json.so
2019-09-30 11:17:51 -04:00
%attr(0644,root,root) %{_libexecdir}/sudo/libsudo_util.so*
%dir /var/db/sudo
%dir /var/db/sudo/lectured
%dir %{_libexecdir}/sudo
%config(noreplace) /etc/pam.d/sudo
%config(noreplace) /etc/pam.d/sudo-i
%config(noreplace) /etc/ld.so.conf.d/*
2023-01-31 20:10:31 +08:00
%license LICENSE.md
2019-09-30 11:17:51 -04:00
%files devel
%{_includedir}/sudo_plugin.h
%files help
%dir %{_pkgdocdir}/
%{_mandir}/man5/*
%{_mandir}/man8/*
%{_mandir}/man1/*
%{_pkgdocdir}/*
%doc plugins/sample/sample_plugin.c
%exclude %{_pkgdocdir}/ChangeLog
%changelog
* Fri Apr 18 2025 fuanan <fuanan3@h-partners.com> - 1.9.15p5-2
- Backport patches from upstream community
2024-01-07 15:59:41 +08:00
* Mon Jan 8 2024 wangqingsan <wangqingsan@huawei.com> - 1.9.15p5-1
- Upgrade to 1.9.15p5
2023-07-19 21:05:32 +08:00
* Wed Jul 19 2023 zhoushuiqing <zhoushuiqing2@huawei.com> - 1.9.14p1-1
- Upgrade to 1.9.14p1
2023-04-12 03:38:27 +00:00
* Wed Apr 12 2023 wangyu <wangyu283@huawei.com> - 1.9.12p2-5
- Fix compilation error on sw64 arch.
2023-03-28 19:49:37 +08:00
* Tue Mar 28 2023 wangcheng <wangcheng156@huawei.com> - 1.9.12p2-4
- Fix CVE-2023-28486 and CVE-2023-28487
2023-03-10 02:23:52 +00:00
* Fri Mar 10 2023 wangyu <wangyu283@huawei.com> - 1.9.12p2-3
- Fix CVE-2023-27320.
* Mon Mar 06 2023 wangyu <wangyu283@huawei.com> - 1.9.12p2-2
- Remove -rpath option.
2023-01-31 20:10:31 +08:00
* Tue Jan 31 2023 wangyu <wangyu283@huawei.com> - 1.9.12p2-1
- Upgrade to 1.9.12p2
* Thu Jan 19 2023 houmingyong<houmingyong@huawei.com> - 1.9.8p2-8
- Fix CVE-2023-22809
* Thu Dec 08 2022 wangyu <wangyu283@huawei.com> - 1.9.8p2-7
- Backport patches from upstream community
* Fri Nov 25 2022 wangyu <wangyu283@huawei.com> - 1.9.8p2-6
- Backport patches from upstream community
* Wed Nov 23 2022 wangyu <wangyu283@huawei.com> - 1.9.8p2-5
- Backport patches from upstream community
2022-11-07 11:15:42 +08:00
* Sat Nov 5 2022 wangyu <wangyu283@huawei.com> - 1.9.8p2-4
- Fix CVE-2022-43995
2022-09-02 10:19:52 +08:00
* Fri Sep 2 2022 wangyu <wangyu283@huawei.com> - 1.9.8p2-2
- Fix CVE-2022-37434 and CVE-2022-33070
2022-02-15 09:30:17 +08:00
* Tue Feb 15 2022 panxiaohe <panxh.life@foxmail.com> - 1.9.8p2-1
- Update to 1.9.8p2
* Thu Sep 16 2021 yixiangzhike <zhangxingliang3@huawei.com> - 1.9.5p2-3
- DESC: treat stack exhaustion like memory allocation failure
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.9.5p2-2
- DESC: delete -S git from %autosetup, and delete BuildRequires git
2021-07-07 16:19:45 +08:00
* Wed Jul 7 2021 panxiaohe <panxiaohe@huawei.com> - 1.9.5p2-1
- Update to 1.9.5p2
* Fri Jan 29 2021 zoulin <zoulin13@huawei.com> - 1.9.2-3
- Fix runstatedir handling for distros that do not support it
* Wed Jan 27 2021 panxiaohe <panxiaohe@huawei.com> - 1.9.2-2
- fix CVE-2021-23239 CVE-2021-23240 CVE-2021-3156
2020-07-28 19:44:17 +08:00
* Wed Jul 29 2020 zhangxingliang <zhangxingliang3@huawei.com> - 1.9.2-1
- update to 1.9.2
2020-05-07 15:14:07 +08:00
* Fri Apr 17 2020 Anakin Zhang <nbztx@126.com> - 1.8.27-5
2020-04-17 10:34:03 +08:00
- Read drop-in files from /etc/sudoers.d
2020-01-20 16:22:06 +08:00
* Mon Jan 20 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.8.27-4
- fix CVE-2019-19232 and CVE-2019-19234
2020-01-11 10:43:18 +08:00
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.8.27-3
- clean code
2019-12-25 16:08:18 +08:00
* Mon Dec 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.8.27-2
- Fix CVE-2019-14287
2019-09-30 11:17:51 -04:00
* Tue Aug 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.8.27-1
- Package init