]>
Commit | Line | Data |
---|---|---|
7612bda9 | 1 | # |
7df1c00d | 2 | # Conditional build: |
9baa7f8b ER |
3 | %if "%{pld_release}" == "ac" |
4 | %bcond_with audit # Linux audit support | |
5 | %else | |
95abd744 | 6 | %bcond_without audit # Linux audit support |
9baa7f8b | 7 | %endif |
30831543 JB |
8 | %bcond_with kerberos5 # Kerberos V support (conflicts with PAM) |
9 | %bcond_without ldap # LDAP support | |
10 | %bcond_without pam # PAM support | |
11 | %bcond_without selinux # SELinux support | |
12 | %bcond_with skey # skey (onetime passwords) support (conflicts with PAM) | |
13 | %bcond_without sssd # SSSD support plugin | |
8e94d95e | 14 | %bcond_without tests # do not perform "make check" |
ce01611a | 15 | %bcond_without apparmor # AppArmor support |
14b70151 ER |
16 | |
17 | %if "%{pld_release}" == "ac" | |
18 | %define pam_ver 0.80.1 | |
19 | %else | |
20 | %define pam_ver 0.99.7.1 | |
21 | %endif | |
22 | ||
503af0bc | 23 | Summary: Allows command execution as root for specified users |
3e9a1f39 ER |
24 | Summary(es.UTF-8): Permite que usuarios específicos ejecuten comandos como se fueran el root |
25 | Summary(ja.UTF-8): 指定ユーザに制限付のroot権限を許可する | |
26 | Summary(pl.UTF-8): Umożliwia wykonywanie poleceń jako root dla konkretnych użytkowników | |
27 | Summary(pt_BR.UTF-8): Permite que usuários específicos executem comandos como se fossem o root | |
28 | Summary(ru.UTF-8): Позволяет определенным пользователям исполнять команды от имени root | |
29 | Summary(uk.UTF-8): Дозволяє вказаним користувачам виконувати команди від імені root | |
503af0bc | 30 | Name: sudo |
ce01611a | 31 | # please see docs/UPGRADE.md for important changes each time updating sudo |
036c55c5 | 32 | Version: 1.9.15p5 |
ed6c0921 | 33 | Release: 1 |
f96f7820 | 34 | Epoch: 1 |
6e8425a9 | 35 | License: BSD |
e71b3bd8 | 36 | Group: Applications/System |
de00551e | 37 | Source0: https://www.sudo.ws/dist/%{name}-%{version}.tar.gz |
036c55c5 | 38 | # Source0-md5: 4166279cb188ecb6641c7a2ba5f68270 |
e71b3bd8 | 39 | Source1: %{name}.pamd |
d2bc6fd7 | 40 | Source2: %{name}-i.pamd |
4be73cd1 JB |
41 | Patch0: %{name}-env.patch |
42 | Patch1: config.patch | |
605c7cc4 | 43 | Patch2: %{name}-sh.patch |
2c7dece1 | 44 | URL: http://www.sudo.ws/sudo/ |
95abd744 | 45 | %{?with_audit:BuildRequires: audit-libs-devel} |
2a838463 | 46 | BuildRequires: autoconf >= 2.69 |
2c255aa3 | 47 | BuildRequires: automake |
95abd744 JB |
48 | BuildRequires: bison |
49 | BuildRequires: flex | |
a2bbf8a6 | 50 | BuildRequires: gettext-tools |
d9c59312 | 51 | BuildRequires: groff |
68ebed37 | 52 | %{?with_kerberos5:BuildRequires: heimdal-devel} |
ce01611a | 53 | %{?with_apparmor:BuildRequires: libapparmor-devel} |
50eae64a | 54 | %{?with_selinux:BuildRequires: libselinux-devel} |
d6064043 | 55 | BuildRequires: libtool >= 2:2.2.6 |
b96e1495 | 56 | %{?with_ldap:BuildRequires: openldap-devel >= 2.3.0} |
c4cb6c42 | 57 | %{?with_pam:BuildRequires: pam-devel} |
14b70151 | 58 | BuildRequires: rpm >= 4.4.9-56 |
2893ac93 | 59 | BuildRequires: rpm-build >= 4.6 |
bb80494b | 60 | BuildRequires: rpmbuild(macros) >= 1.752 |
50eae64a | 61 | %{?with_skey:BuildRequires: skey-devel >= 2.2-11} |
63a8eea5 | 62 | BuildRequires: zlib-devel |
5c9f727f | 63 | %if "%{pld_release}" != "ac" |
b771ccac JB |
64 | # uses /run |
65 | Requires: FHS >= 3.0 | |
5c9f727f | 66 | %endif |
14b70151 | 67 | Requires: pam >= %{pam_ver} |
f6636f28 | 68 | Obsoletes: cu-sudo < 1.6 |
7df1c00d | 69 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
60f3cbe5 | 70 | |
02cd30f3 ER |
71 | %define schemadir /usr/share/openldap/schema |
72 | ||
4be73cd1 JB |
73 | # uses sudo_warn_*_v1 symbols from binaries |
74 | %define skip_post_check_so libsudo_util.so.* | |
75 | ||
60f3cbe5 | 76 | %description |
9739caca | 77 | Sudo (superuser do) allows a permitted user to execute a command as |
78 | the superuser (real and effective uid and gid are set to 0 and root's | |
79 | group as set in the passwd file respectively). | |
b0356f24 | 80 | |
60f3cbe5 | 81 | Sudo determines who is an authorized user by consulting the file |
9739caca | 82 | /etc/sudoers. By giving sudo the -v flag a user can update the time |
83 | stamp without running a command. The password prompt itself will also | |
84 | time out if the password is not entered with N minutes (again, this is | |
85 | defined at installation time and defaults to 5 minutes). | |
60f3cbe5 | 86 | |
85bc7a24 | 87 | %description -l es.UTF-8 |
485535e1 | 88 | Sudo (superuser do) permite que el administrador del sistema otorga a |
89 | ciertos usuarios (o grupos de usuarios) la habilidad para ejecutar | |
90 | algunos (o todos) comandos como root, registrando todos los comandos y | |
91 | argumentos. Sudo opera en una base por comando, no siendo un | |
92 | substituto para la shell. | |
93 | ||
85bc7a24 | 94 | %description -l ja.UTF-8 |
bec81e97 ER |
95 | sudo (superuser do) |
96 | とはシステム管理者が、信用できるユーザ(またはグループ)に対 | |
97 | して、いくつか(もしくは全て)のコマンドを root | |
98 | として実行できるよう、そのコマン | |
99 | ドの実行履歴のログをとりつつ許可する仕組みです。sudo | |
100 | はコマンド一行単位で動作 | |
85bc7a24 JR |
101 | します。シェルの置き換えではありません。以下の機能を内蔵しています。ホスト単位 |
102 | で、そのコマンドを実行可能なユーザを制限する機能、各コマンドについての(誰がな | |
bec81e97 ER |
103 | にを実行したかの痕跡を残すための)豊富なロギング機能、sudo |
104 | コマンドのタイムアウ | |
105 | ト時間を設定可能、複数のマシンで同一の設定ファイル(sudoers)を共有する機能、が | |
106 | あります。 | |
c34eaf08 | 107 | |
85bc7a24 JR |
108 | %description -l pl.UTF-8 |
109 | Sudo (superuser do) umożliwia wykonywanie konkretnych poleceń jako | |
110 | root dla wyspecyfikowanych użytkowników (rzeczywiste i efektywne | |
111 | uid/gid podczas wykonywania tych programów jest 0). To kto może | |
112 | wykonywać konkretne polecenia i w jaki sposób ma być autoryzowany jest | |
9739caca | 113 | opisane w pliku /etc/sudoers. |
60f3cbe5 | 114 | |
85bc7a24 JR |
115 | %description -l pt_BR.UTF-8 |
116 | Sudo (superuser do) permite que o administrador do sistema dê a certos | |
117 | usuários (ou grupos de usuários) a habilidade para rodar alguns (ou | |
485535e1 | 118 | todos) comandos como root, registrando todos os comandos e argumentos. |
85bc7a24 | 119 | Sudo opera numa base por comando, não sendo um substituto para a |
485535e1 | 120 | shell. |
121 | ||
85bc7a24 JR |
122 | %description -l ru.UTF-8 |
123 | Sudo (superuser do) позволяет системному администратору предоставлять | |
124 | определенным пользователям (или их группам) возможность исполнять | |
125 | некоторые (или все) команды с правами root, при этом протоколируя все | |
126 | команды и аргументы. Sudo работает с отдельными командами, это не | |
127 | замена командной оболочки (shell). Некоторые из возможностей sudo: | |
128 | ограничение того, какие команды пользователь может запускать в | |
129 | зависимости от хоста; полное протоколирование каждой команды; | |
130 | настраиваемое время, на протяжении которого sudo помнит пароль; | |
131 | использование одного конфигурационного файла (sudoers) на многих | |
132 | машинах. | |
c34eaf08 | 133 | |
85bc7a24 JR |
134 | %description -l uk.UTF-8 |
135 | Sudo (superuser do) дозволяє системному адміністраторові надати певним | |
136 | користувачам (чи їх групам) можливість виконувати деякі (чи всі) | |
137 | команди з правами root, при цьому протоколюючи всі команди та | |
138 | аргументи. Sudo працює з окремими командами, це не заміна командної | |
139 | оболонки (shell). Деякі з можливостей sudo: обмеження того, які | |
140 | команди користувач може запускати в залежності від хоста; повне | |
141 | протоколювання кожної команди; настроюваний час, на протязі якого sudo | |
142 | пам'ятає пароль; використання одного конфігураційного файлу (sudoers) | |
143 | на багатьох машинах. | |
c34eaf08 | 144 | |
9f41d987 JB |
145 | %package devel |
146 | Summary: Header file for sudo plugins development | |
147 | Summary(pl.UTF-8): Plik nagłówkowy do tworzenia wtyczek dla sudo | |
148 | Group: Development/Libraries | |
149 | ||
150 | %description devel | |
151 | Header file for sudo plugins development. | |
152 | ||
153 | %description devel -l pl.UTF-8 | |
154 | Plik nagłówkowy do tworzenia wtyczek dla sudo. | |
155 | ||
02cd30f3 ER |
156 | %package -n openldap-schema-sudo |
157 | Summary: Sudo LDAP schema | |
3587fdcd | 158 | Summary(pl.UTF-8): Schemat bazy sudo dla LDAP |
02cd30f3 ER |
159 | Group: Networking/Daemons |
160 | Requires(post,postun): sed >= 4.0 | |
161 | Requires: openldap-servers | |
162 | Requires: sed >= 4.0 | |
50effa53 | 163 | BuildArch: noarch |
02cd30f3 ER |
164 | |
165 | %description -n openldap-schema-sudo | |
166 | This package contains sudo.schema for openldap. | |
167 | ||
168 | %description -n openldap-schema-sudo -l pl.UTF-8 | |
169 | Ten pakiet zawiera sudo.schema dla pakietu openldap. | |
170 | ||
bb80494b JB |
171 | %package logsrvd |
172 | Summary: High-performance log server for sudo | |
173 | Summary(pl.UTF-8): Wysoko wydajny serwer logujący dla sudo | |
d8dd1d78 AM |
174 | Group: Daemons |
175 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
176 | ||
bb80494b JB |
177 | %description logsrvd |
178 | sudo-logsrvd is a high-performance log server that accepts event | |
d8dd1d78 AM |
179 | and I/O logs from sudo. It can be used to implement centralized |
180 | logging of sudo logs. | |
181 | ||
bb80494b JB |
182 | %description logsrvd -l pl.UTF-8 |
183 | sudo-logsrvd to wysoko wydajny serwer logujący przyjmyjący logi | |
184 | zdarzeń i we/wy z sudo. Może byc używany do zaimplementowania | |
185 | scentralizowanego logowania z sudo. | |
186 | ||
60f3cbe5 | 187 | %prep |
5a7b980b | 188 | %setup -q |
7df1c00d | 189 | # only local macros |
605c7cc4 | 190 | %{__mv} aclocal.m4 acinclude.m4 |
3da66796 | 191 | # do not load libtool macros from acinclude |
1e0a7c25 | 192 | cp -p acinclude.m4 acinclude.m4.orig |
3da66796 | 193 | %{__sed} -i -e '/Pull in libtool macros/,$d' acinclude.m4 |
7df1c00d | 194 | |
bd33fb9b | 195 | %patch0 -p1 |
7df1c00d | 196 | %patch1 -p1 |
605c7cc4 | 197 | %patch2 -p1 |
7df1c00d | 198 | |
60f3cbe5 | 199 | %build |
7df1c00d | 200 | %{__libtoolize} |
dc47c82d | 201 | %{__aclocal} -I m4 |
7df1c00d | 202 | %{__autoconf} |
2e2fb1cb | 203 | %configure \ |
7df1c00d | 204 | NROFFPROG=nroff \ |
95abd744 | 205 | --enable-zlib=system \ |
ce01611a | 206 | %{__with_without apparmor} \ |
95abd744 JB |
207 | --with-env-editor \ |
208 | --with-ignore-dot \ | |
a0533340 | 209 | --with-incpath=/usr/include/security \ |
cec6feeb AM |
210 | --with-logfac=authpriv \ |
211 | --with-logging=syslog \ | |
95abd744 | 212 | --with-loglen=320 \ |
213866f0 | 213 | --with-logpath=/var/log/sudo \ |
95abd744 JB |
214 | --with-long-otp-prompt \ |
215 | --with-pam \ | |
216 | --with-pam-login \ | |
42163b23 | 217 | --with-passprompt="[sudo] password for %%p: " \ |
a0533340 | 218 | --with-secure-path="/bin:/sbin:/usr/bin:/usr/sbin" \ |
cec6feeb | 219 | --with-tty-tickets \ |
0c7914d4 | 220 | --with-exampledir=%{_examplesdir}/%{name}-%{version} \ |
2f5cbf09 | 221 | --enable-tmpfiles.d=%{systemdtmpfilesdir} \ |
9ca9a4a5 ER |
222 | %{__with kerberos5 kerb5} \ |
223 | %{__with ldap} \ | |
224 | %{__with audit linux-audit} \ | |
225 | %{__with selinux} \ | |
226 | %{__with skey} \ | |
227 | %{__with sssd} \ | |
60f3cbe5 | 228 | |
325b84c6 | 229 | %{__make} |
60f3cbe5 | 230 | |
7cd93059 AM |
231 | %{?with_tests:%{__make} check} |
232 | ||
60f3cbe5 | 233 | %install |
234 | rm -rf $RPM_BUILD_ROOT | |
605c7cc4 | 235 | install -d $RPM_BUILD_ROOT{/etc/pam.d,/var/log/sudo-io} |
3da66796 | 236 | |
af50df21 SS |
237 | %{__make} -j1 install \ |
238 | DESTDIR=$RPM_BUILD_ROOT \ | |
02cd30f3 ER |
239 | install_uid=$(id -u) \ |
240 | install_gid=$(id -g) \ | |
241 | sudoers_uid=$(id -u) \ | |
5972204f MB |
242 | sudoers_gid=$(id -g) \ |
243 | shlib_mode="0755" | |
60f3cbe5 | 244 | |
926d4d83 ER |
245 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.dist |
246 | ||
63a8eea5 ER |
247 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo |
248 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i | |
e39eae9c | 249 | |
1522848b ER |
250 | %if "%{pld_release}" == "ac" |
251 | # not present in ac, no point searching it | |
252 | %{__sed} -i -e '/pam_keyinit.so/d' $RPM_BUILD_ROOT/etc/pam.d/sudo* | |
253 | %endif | |
254 | ||
3e34f990 | 255 | %{__rm} $RPM_BUILD_ROOT%{_libexecdir}/sudo/*.la |
63a8eea5 | 256 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} |
7df1c00d | 257 | |
02cd30f3 ER |
258 | %if %{with ldap} |
259 | install -d $RPM_BUILD_ROOT%{schemadir} | |
ce01611a | 260 | cp -p docs/schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema |
02cd30f3 | 261 | %endif |
206acba3 | 262 | |
9f41d987 JB |
263 | # sudo,sudoers domains |
264 | %find_lang %{name} --all-name | |
265 | ||
60f3cbe5 | 266 | %clean |
267 | rm -rf $RPM_BUILD_ROOT | |
268 | ||
02cd30f3 ER |
269 | %post -n openldap-schema-sudo |
270 | %openldap_schema_register %{schemadir}/sudo.schema -d core | |
271 | %service -q ldap restart | |
63a8eea5 | 272 | %banner -o -e openldap-schema-sudo <<'EOF' |
02cd30f3 ER |
273 | NOTE: |
274 | In order for sudoRole LDAP queries to be efficient, the server must index | |
275 | the attribute 'sudoUser', e.g. | |
276 | ||
277 | # Indices to maintain | |
278 | index sudoUser eq | |
279 | EOF | |
02cd30f3 ER |
280 | |
281 | %postun -n openldap-schema-sudo | |
282 | if [ "$1" = "0" ]; then | |
283 | %openldap_schema_unregister %{schemadir}/sudo.schema | |
284 | %service -q ldap restart | |
285 | fi | |
286 | ||
6519a971 | 287 | %triggerpostun -- %{name} < 1:1.8.7-2 |
6519a971 | 288 | # 1:1.8.7-2 |
037b070e ER |
289 | # add include statement to sudoers |
290 | if ! grep -q '#includedir %{_sysconfdir}/sudoers.d' /etc/sudoers; then | |
291 | echo 'Adding includedir %{_sysconfdir}/sudoers.d to /etc/sudoers' | |
292 | cat <<-EOF >> /etc/sudoers | |
293 | ## Read drop-in files from %{_sysconfdir}/sudoers.d | |
294 | ## (the '#' here does not indicate a comment) | |
295 | #includedir %{_sysconfdir}/sudoers.d | |
296 | EOF | |
297 | fi | |
298 | ||
9f41d987 | 299 | %files -f %{name}.lang |
503af0bc | 300 | %defattr(644,root,root,755) |
ce01611a JP |
301 | %doc ChangeLog LICENSE.md NEWS README.md docs/{CONTRIBUTORS,HISTORY,TROUBLESHOOTING,UPGRADE}.md |
302 | %{?with_ldap:%doc README.LDAP.md} | |
d110a738 | 303 | %attr(550,root,root) %dir %{_sysconfdir}/sudoers.d |
50eae64a | 304 | %attr(440,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudoers |
d8dd1d78 | 305 | %attr(640,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudo.conf |
50eae64a | 306 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo |
d2bc6fd7 | 307 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo-i |
605c7cc4 | 308 | %attr(755,root,root) %{_bindir}/cvtsudoers |
7df1c00d JB |
309 | %attr(4755,root,root) %{_bindir}/sudo |
310 | %attr(4755,root,root) %{_bindir}/sudoedit | |
3da66796 | 311 | %attr(755,root,root) %{_bindir}/sudoreplay |
7df1c00d | 312 | %attr(755,root,root) %{_sbindir}/visudo |
3e34f990 JB |
313 | %dir %{_libexecdir}/sudo |
314 | %attr(755,root,root) %{_libexecdir}/sudo/libsudo_util.so.*.*.* | |
315 | %attr(755,root,root) %{_libexecdir}/sudo/libsudo_util.so.0 | |
316 | %attr(755,root,root) %{_libexecdir}/sudo/libsudo_util.so | |
317 | %{?with_selinux:%attr(755,root,root) %{_libexecdir}/sudo/sesh} | |
d8dd1d78 | 318 | %attr(755,root,root) %{_libexecdir}/sudo/audit_json.so |
3e34f990 | 319 | %attr(755,root,root) %{_libexecdir}/sudo/group_file.so |
0297c142 | 320 | %attr(755,root,root) %{_libexecdir}/sudo/sudo_intercept.so |
3e34f990 JB |
321 | %attr(755,root,root) %{_libexecdir}/sudo/sudo_noexec.so |
322 | %attr(755,root,root) %{_libexecdir}/sudo/sudoers.so | |
323 | %attr(755,root,root) %{_libexecdir}/sudo/system_group.so | |
605c7cc4 | 324 | %{_mandir}/man1/cvtsudoers.1* |
ce01611a | 325 | %{_mandir}/man5/sudo_plugin.5* |
ff6a027f | 326 | %{_mandir}/man5/sudoers.5* |
605c7cc4 | 327 | %{_mandir}/man5/sudoers_timestamp.5* |
7cd93059 | 328 | %{_mandir}/man5/sudo.conf.5* |
14b70151 | 329 | %{?with_ldap:%{_mandir}/man5/sudoers.ldap.5*} |
938895e3 | 330 | %{_mandir}/man8/sudo.8* |
ff6a027f | 331 | %{_mandir}/man8/sudoedit.8* |
3da66796 | 332 | %{_mandir}/man8/sudoreplay.8* |
ff6a027f | 333 | %{_mandir}/man8/visudo.8* |
15ce7c31 | 334 | %{systemdtmpfilesdir}/%{name}.conf |
0c7914d4 | 335 | %{_examplesdir}/%{name}-%{version} |
63a8eea5 | 336 | %attr(700,root,root) /var/log/sudo-io |
67f231a2 | 337 | %attr(700,root,root) %dir /var/db/sudo |
02cd30f3 | 338 | |
9f41d987 JB |
339 | %files devel |
340 | %defattr(644,root,root,755) | |
341 | %{_includedir}/sudo_plugin.h | |
342 | ||
dd41247c | 343 | %if %{with ldap} |
02cd30f3 ER |
344 | %files -n openldap-schema-sudo |
345 | %defattr(644,root,root,755) | |
3587fdcd | 346 | %{schemadir}/sudo.schema |
dd41247c | 347 | %endif |
d8dd1d78 AM |
348 | |
349 | %files logsrvd | |
350 | %defattr(644,root,root,755) | |
351 | %attr(640,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudo_logsrvd.conf | |
352 | %attr(755,root,root) %{_sbindir}/sudo_logsrvd | |
353 | %attr(755,root,root) %{_sbindir}/sudo_sendlog | |
354 | %{_mandir}/man5/sudo_logsrv.proto.5* | |
355 | %{_mandir}/man5/sudo_logsrvd.conf.5* | |
356 | %{_mandir}/man8/sudo_logsrvd.8* | |
357 | %{_mandir}/man8/sudo_sendlog.8* |