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