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