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