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