]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %if "%{pld_release}" == "ac" | |
4 | %bcond_with audit # Linux audit support | |
5 | %else | |
6 | %bcond_without audit # Linux audit support | |
7 | %endif | |
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 | |
14 | %bcond_without tests # do not perform "make check" | |
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 | ||
22 | Summary: Allows command execution as root for specified users | |
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 | |
29 | Name: sudo | |
30 | # please see doc/UPGRADE for important changes each time updating sudo | |
31 | Version: 1.8.26 | |
32 | Release: 1 | |
33 | Epoch: 1 | |
34 | License: BSD | |
35 | Group: Applications/System | |
36 | Source0: ftp://ftp.sudo.ws/pub/sudo/%{name}-%{version}.tar.gz | |
37 | # Source0-md5: 833084947d98e7745b94845f4b7a8a9a | |
38 | Source1: %{name}.pamd | |
39 | Source2: %{name}-i.pamd | |
40 | Patch0: %{name}-env.patch | |
41 | Patch1: config.patch | |
42 | Patch2: %{name}-sh.patch | |
43 | URL: http://www.sudo.ws/sudo/ | |
44 | %{?with_audit:BuildRequires: audit-libs-devel} | |
45 | BuildRequires: autoconf >= 2.53 | |
46 | BuildRequires: autoconf-archive | |
47 | BuildRequires: automake | |
48 | BuildRequires: bison | |
49 | BuildRequires: flex | |
50 | BuildRequires: gettext-devel | |
51 | BuildRequires: groff | |
52 | %{?with_kerberos5:BuildRequires: heimdal-devel} | |
53 | %{?with_selinux:BuildRequires: libselinux-devel} | |
54 | BuildRequires: libtool >= 2:2.2.6 | |
55 | %{?with_ldap:BuildRequires: openldap-devel >= 2.3.0} | |
56 | %{?with_pam:BuildRequires: pam-devel} | |
57 | BuildRequires: rpm >= 4.4.9-56 | |
58 | BuildRequires: rpmbuild(macros) >= 1.595 | |
59 | %{?with_skey:BuildRequires: skey-devel >= 2.2-11} | |
60 | BuildRequires: zlib-devel | |
61 | # uses /run | |
62 | Requires: FHS >= 3.0 | |
63 | Requires: pam >= %{pam_ver} | |
64 | Obsoletes: cu-sudo | |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %define schemadir /usr/share/openldap/schema | |
68 | ||
69 | # uses sudo_warn_*_v1 symbols from binaries | |
70 | %define skip_post_check_so libsudo_util.so.* | |
71 | ||
72 | %description | |
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). | |
76 | ||
77 | Sudo determines who is an authorized user by consulting the file | |
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). | |
82 | ||
83 | %description -l es.UTF-8 | |
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 | ||
90 | %description -l ja.UTF-8 | |
91 | sudo (superuser do) | |
92 | とはシステム管理者が、信用できるユーザ(またはグループ)に対 | |
93 | して、いくつか(もしくは全て)のコマンドを root | |
94 | として実行できるよう、そのコマン | |
95 | ドの実行履歴のログをとりつつ許可する仕組みです。sudo | |
96 | はコマンド一行単位で動作 | |
97 | します。シェルの置き換えではありません。以下の機能を内蔵しています。ホスト単位 | |
98 | で、そのコマンドを実行可能なユーザを制限する機能、各コマンドについての(誰がな | |
99 | にを実行したかの痕跡を残すための)豊富なロギング機能、sudo | |
100 | コマンドのタイムアウ | |
101 | ト時間を設定可能、複数のマシンで同一の設定ファイル(sudoers)を共有する機能、が | |
102 | あります。 | |
103 | ||
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 | |
109 | opisane w pliku /etc/sudoers. | |
110 | ||
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 | |
114 | todos) comandos como root, registrando todos os comandos e argumentos. | |
115 | Sudo opera numa base por comando, não sendo um substituto para a | |
116 | shell. | |
117 | ||
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 | машинах. | |
129 | ||
130 | %description -l uk.UTF-8 | |
131 | Sudo (superuser do) дозволяє системному адміністраторові надати певним | |
132 | користувачам (чи їх групам) можливість виконувати деякі (чи всі) | |
133 | команди з правами root, при цьому протоколюючи всі команди та | |
134 | аргументи. Sudo працює з окремими командами, це не заміна командної | |
135 | оболонки (shell). Деякі з можливостей sudo: обмеження того, які | |
136 | команди користувач може запускати в залежності від хоста; повне | |
137 | протоколювання кожної команди; настроюваний час, на протязі якого sudo | |
138 | пам'ятає пароль; використання одного конфігураційного файлу (sudoers) | |
139 | на багатьох машинах. | |
140 | ||
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 | ||
152 | %package -n openldap-schema-sudo | |
153 | Summary: Sudo LDAP schema | |
154 | Summary(pl.UTF-8): Schemat bazy sudo dla LDAP | |
155 | Group: Networking/Daemons | |
156 | Requires(post,postun): sed >= 4.0 | |
157 | Requires: openldap-servers | |
158 | Requires: sed >= 4.0 | |
159 | %if "%{_rpmversion}" >= "5" | |
160 | BuildArch: noarch | |
161 | %endif | |
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 | ||
169 | %prep | |
170 | %setup -q | |
171 | # only local macros | |
172 | %{__mv} aclocal.m4 acinclude.m4 | |
173 | # do not load libtool macros from acinclude | |
174 | cp -p acinclude.m4 acinclude.m4.orig | |
175 | %{__sed} -i -e '/Pull in libtool macros/,$d' acinclude.m4 | |
176 | ||
177 | %patch0 -p1 | |
178 | %patch1 -p1 | |
179 | %patch2 -p1 | |
180 | ||
181 | ! [ -f m4/ax_sys_weak_alias.m4 ] # provide own copy only until it is there | |
182 | cp %{_aclocaldir}/ax_sys_weak_alias.m4 m4 | |
183 | ||
184 | %build | |
185 | %{__mv} install-sh install-custom-sh | |
186 | %{__libtoolize} | |
187 | %{__mv} install-custom-sh install-sh | |
188 | cp -f /usr/share/automake/config.sub . | |
189 | %{__aclocal} -I m4 | |
190 | %{__autoconf} | |
191 | %configure \ | |
192 | NROFFPROG=nroff \ | |
193 | --enable-zlib=system \ | |
194 | --with-env-editor \ | |
195 | --with-ignore-dot \ | |
196 | --with-incpath=/usr/include/security \ | |
197 | --with-logfac=authpriv \ | |
198 | --with-logging=syslog \ | |
199 | --with-loglen=320 \ | |
200 | --with-logpath=/var/log/sudo \ | |
201 | --with-long-otp-prompt \ | |
202 | --with-pam \ | |
203 | --with-pam-login \ | |
204 | --with-passprompt="[sudo] password for %%p: " \ | |
205 | --with-secure-path="/bin:/sbin:/usr/bin:/usr/sbin" \ | |
206 | --with-tty-tickets \ | |
207 | --with-exampledir=%{_examplesdir}/%{name}-%{version} \ | |
208 | --enable-tmpfiles.d=%{systemdtmpfilesdir} \ | |
209 | %{__with kerberos5 kerb5} \ | |
210 | %{__with ldap} \ | |
211 | %{__with audit linux-audit} \ | |
212 | %{__with selinux} \ | |
213 | %{__with skey} \ | |
214 | %{__with sssd} \ | |
215 | ||
216 | %{__make} | |
217 | ||
218 | %{?with_tests:%{__make} check} | |
219 | ||
220 | %install | |
221 | rm -rf $RPM_BUILD_ROOT | |
222 | install -d $RPM_BUILD_ROOT{/etc/pam.d,/var/log/sudo-io} | |
223 | ||
224 | %{__make} -j1 install \ | |
225 | DESTDIR=$RPM_BUILD_ROOT \ | |
226 | install_uid=$(id -u) \ | |
227 | install_gid=$(id -g) \ | |
228 | sudoers_uid=$(id -u) \ | |
229 | sudoers_gid=$(id -g) \ | |
230 | shlib_mode="0755" | |
231 | ||
232 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.dist | |
233 | ||
234 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo | |
235 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i | |
236 | ||
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 | ||
242 | %{__rm} $RPM_BUILD_ROOT%{_libexecdir}/sudo/*.la | |
243 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} | |
244 | ||
245 | %if %{with ldap} | |
246 | install -d $RPM_BUILD_ROOT%{schemadir} | |
247 | cp -p doc/schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema | |
248 | %endif | |
249 | ||
250 | # sudo,sudoers domains | |
251 | %find_lang %{name} --all-name | |
252 | ||
253 | %clean | |
254 | rm -rf $RPM_BUILD_ROOT | |
255 | ||
256 | %post -n openldap-schema-sudo | |
257 | %openldap_schema_register %{schemadir}/sudo.schema -d core | |
258 | %service -q ldap restart | |
259 | %banner -o -e openldap-schema-sudo <<'EOF' | |
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 | |
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 | ||
274 | %triggerpostun -- %{name} < 1:1.8.7-2 | |
275 | # 1:1.8.7-2 | |
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 | ||
286 | %files -f %{name}.lang | |
287 | %defattr(644,root,root,755) | |
288 | %doc ChangeLog NEWS README doc/{CONTRIBUTORS,HISTORY,LICENSE,TROUBLESHOOTING,UPGRADE} | |
289 | %{?with_ldap:%doc README.LDAP} | |
290 | %attr(550,root,root) %dir %{_sysconfdir}/sudoers.d | |
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 | |
293 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo-i | |
294 | %attr(755,root,root) %{_bindir}/cvtsudoers | |
295 | %attr(4755,root,root) %{_bindir}/sudo | |
296 | %attr(4755,root,root) %{_bindir}/sudoedit | |
297 | %attr(755,root,root) %{_bindir}/sudoreplay | |
298 | %attr(755,root,root) %{_sbindir}/visudo | |
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 | |
308 | %{_mandir}/man1/cvtsudoers.1* | |
309 | %{_mandir}/man5/sudoers.5* | |
310 | %{_mandir}/man5/sudoers_timestamp.5* | |
311 | %{_mandir}/man5/sudo.conf.5* | |
312 | %{?with_ldap:%{_mandir}/man5/sudoers.ldap.5*} | |
313 | %{_mandir}/man8/sudo.8* | |
314 | %{_mandir}/man8/sudo_plugin.8* | |
315 | %{_mandir}/man8/sudoedit.8* | |
316 | %{_mandir}/man8/sudoreplay.8* | |
317 | %{_mandir}/man8/visudo.8* | |
318 | %{systemdtmpfilesdir}/%{name}.conf | |
319 | %{_examplesdir}/%{name}-%{version} | |
320 | %attr(700,root,root) /var/log/sudo-io | |
321 | %attr(700,root,root) %dir /var/db/sudo | |
322 | ||
323 | %files devel | |
324 | %defattr(644,root,root,755) | |
325 | %{_includedir}/sudo_plugin.h | |
326 | ||
327 | %if %{with ldap} | |
328 | %files -n openldap-schema-sudo | |
329 | %defattr(644,root,root,755) | |
330 | %{schemadir}/sudo.schema | |
331 | %endif |