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