]>
Commit | Line | Data |
---|---|---|
7612bda9 | 1 | # |
7df1c00d | 2 | # Conditional build: |
95abd744 | 3 | %bcond_without audit # Linux audit support |
c4cb6c42 | 4 | %bcond_with kerberos5 # enable Kerberos V support (conflicts with PAM) |
2152ffa7 | 5 | %bcond_without ldap # disable LDAP support |
c4cb6c42 JB |
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) | |
14b70151 ER |
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 | ||
503af0bc | 16 | Summary: Allows command execution as root for specified users |
3e9a1f39 ER |
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 | |
503af0bc | 23 | Name: sudo |
477522d2 | 24 | Version: 1.8.6p8 |
0f25343f | 25 | Release: 1 |
f96f7820 | 26 | Epoch: 1 |
6e8425a9 | 27 | License: BSD |
e71b3bd8 | 28 | Group: Applications/System |
2c7dece1 | 29 | Source0: ftp://ftp.sudo.ws/pub/sudo/%{name}-%{version}.tar.gz |
477522d2 | 30 | # Source0-md5: 6dac48c73c8e0932980efcddafa569af |
e71b3bd8 | 31 | Source1: %{name}.pamd |
d2bc6fd7 JR |
32 | Source2: %{name}-i.pamd |
33 | Source3: %{name}.logrotate | |
12abf713 ER |
34 | Patch0: %{name}-libtool.patch |
35 | Patch1: %{name}-env.patch | |
1e0a7c25 | 36 | Patch2: config.patch |
2c7dece1 | 37 | URL: http://www.sudo.ws/sudo/ |
95abd744 | 38 | %{?with_audit:BuildRequires: audit-libs-devel} |
7df1c00d | 39 | BuildRequires: autoconf >= 2.53 |
2c255aa3 | 40 | BuildRequires: automake |
95abd744 JB |
41 | BuildRequires: bison |
42 | BuildRequires: flex | |
04007bea | 43 | BuildRequires: gettext-devel |
68ebed37 | 44 | %{?with_kerberos5:BuildRequires: heimdal-devel} |
50eae64a | 45 | %{?with_selinux:BuildRequires: libselinux-devel} |
95abd744 | 46 | BuildRequires: libtool >= 2:2.2.6b |
b96e1495 | 47 | %{?with_ldap:BuildRequires: openldap-devel >= 2.3.0} |
c4cb6c42 | 48 | %{?with_pam:BuildRequires: pam-devel} |
14b70151 | 49 | BuildRequires: rpm >= 4.4.9-56 |
63a8eea5 | 50 | BuildRequires: rpmbuild(macros) >= 1.595 |
50eae64a | 51 | %{?with_skey:BuildRequires: skey-devel >= 2.2-11} |
63a8eea5 | 52 | BuildRequires: zlib-devel |
14b70151 | 53 | Requires: pam >= %{pam_ver} |
4c8c6861 | 54 | Obsoletes: cu-sudo |
7df1c00d | 55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
60f3cbe5 | 56 | |
02cd30f3 ER |
57 | %define schemadir /usr/share/openldap/schema |
58 | ||
60f3cbe5 | 59 | %description |
9739caca | 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). | |
b0356f24 | 63 | |
60f3cbe5 | 64 | Sudo determines who is an authorized user by consulting the file |
9739caca | 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). | |
60f3cbe5 | 69 | |
85bc7a24 | 70 | %description -l es.UTF-8 |
485535e1 | 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 | ||
85bc7a24 | 77 | %description -l ja.UTF-8 |
bec81e97 ER |
78 | sudo (superuser do) |
79 | とはシステム管理者が、信用できるユーザ(またはグループ)に対 | |
80 | して、いくつか(もしくは全て)のコマンドを root | |
81 | として実行できるよう、そのコマン | |
82 | ドの実行履歴のログをとりつつ許可する仕組みです。sudo | |
83 | はコマンド一行単位で動作 | |
85bc7a24 JR |
84 | します。シェルの置き換えではありません。以下の機能を内蔵しています。ホスト単位 |
85 | で、そのコマンドを実行可能なユーザを制限する機能、各コマンドについての(誰がな | |
bec81e97 ER |
86 | にを実行したかの痕跡を残すための)豊富なロギング機能、sudo |
87 | コマンドのタイムアウ | |
88 | ト時間を設定可能、複数のマシンで同一の設定ファイル(sudoers)を共有する機能、が | |
89 | あります。 | |
c34eaf08 | 90 | |
85bc7a24 JR |
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 | |
9739caca | 96 | opisane w pliku /etc/sudoers. |
60f3cbe5 | 97 | |
85bc7a24 JR |
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 | |
485535e1 | 101 | todos) comandos como root, registrando todos os comandos e argumentos. |
85bc7a24 | 102 | Sudo opera numa base por comando, não sendo um substituto para a |
485535e1 | 103 | shell. |
104 | ||
85bc7a24 JR |
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 | машинах. | |
c34eaf08 | 116 | |
85bc7a24 JR |
117 | %description -l uk.UTF-8 |
118 | Sudo (superuser do) дозволяє системному адміністраторові надати певним | |
119 | користувачам (чи їх групам) можливість виконувати деякі (чи всі) | |
120 | команди з правами root, при цьому протоколюючи всі команди та | |
121 | аргументи. Sudo працює з окремими командами, це не заміна командної | |
122 | оболонки (shell). Деякі з можливостей sudo: обмеження того, які | |
123 | команди користувач може запускати в залежності від хоста; повне | |
124 | протоколювання кожної команди; настроюваний час, на протязі якого sudo | |
125 | пам'ятає пароль; використання одного конфігураційного файлу (sudoers) | |
126 | на багатьох машинах. | |
c34eaf08 | 127 | |
9f41d987 JB |
128 | %package devel |
129 | Summary: Header file for sudo plugins development | |
130 | Summary(pl.UTF-8): Plik nagłówkowy do tworzenia wtyczek dla sudo | |
131 | Group: Development/Libraries | |
132 | ||
133 | %description devel | |
134 | Header file for sudo plugins development. | |
135 | ||
136 | %description devel -l pl.UTF-8 | |
137 | Plik nagłówkowy do tworzenia wtyczek dla sudo. | |
138 | ||
02cd30f3 ER |
139 | %package -n openldap-schema-sudo |
140 | Summary: Sudo LDAP schema | |
3587fdcd | 141 | Summary(pl.UTF-8): Schemat bazy sudo dla LDAP |
02cd30f3 ER |
142 | Group: Networking/Daemons |
143 | Requires(post,postun): sed >= 4.0 | |
144 | Requires: openldap-servers | |
145 | Requires: sed >= 4.0 | |
146 | ||
147 | %description -n openldap-schema-sudo | |
148 | This package contains sudo.schema for openldap. | |
149 | ||
150 | %description -n openldap-schema-sudo -l pl.UTF-8 | |
151 | Ten pakiet zawiera sudo.schema dla pakietu openldap. | |
152 | ||
60f3cbe5 | 153 | %prep |
5a7b980b | 154 | %setup -q |
7df1c00d | 155 | # only local macros |
63a8eea5 | 156 | mv aclocal.m4 acinclude.m4 |
3da66796 | 157 | # do not load libtool macros from acinclude |
1e0a7c25 | 158 | cp -p acinclude.m4 acinclude.m4.orig |
3da66796 | 159 | %{__sed} -i -e '/Pull in libtool macros/,$d' acinclude.m4 |
7df1c00d | 160 | |
bd33fb9b | 161 | %patch0 -p1 |
7df1c00d | 162 | %patch1 -p1 |
1e0a7c25 | 163 | %patch2 -p1 |
7df1c00d | 164 | |
60f3cbe5 | 165 | %build |
af50df21 | 166 | %{__mv} install-sh install-custom-sh |
7df1c00d | 167 | %{__libtoolize} |
af50df21 | 168 | %{__mv} install-custom-sh install-sh |
0b8ffdaf | 169 | cp -f /usr/share/automake/config.sub . |
dc47c82d | 170 | %{__aclocal} -I m4 |
7df1c00d | 171 | %{__autoconf} |
2e2fb1cb | 172 | %configure \ |
7df1c00d | 173 | NROFFPROG=nroff \ |
95abd744 JB |
174 | --enable-zlib=system \ |
175 | --with-env-editor \ | |
176 | --with-ignore-dot \ | |
a0533340 | 177 | --with-incpath=/usr/include/security \ |
95abd744 JB |
178 | %{?with_kerberos5:--with-kerb5} \ |
179 | %{?with_ldap:--with-ldap} \ | |
180 | %{?with_audit:--with-linux-audit} \ | |
4c8c6861 | 181 | --with-logfac=auth \ |
95abd744 JB |
182 | --with-logging=both \ |
183 | --with-loglen=320 \ | |
213866f0 | 184 | --with-logpath=/var/log/sudo \ |
95abd744 JB |
185 | --with-long-otp-prompt \ |
186 | --with-pam \ | |
187 | --with-pam-login \ | |
42163b23 | 188 | --with-passprompt="[sudo] password for %%p: " \ |
a0533340 | 189 | --with-secure-path="/bin:/sbin:/usr/bin:/usr/sbin" \ |
95abd744 JB |
190 | %{?with_selinux:--with-selinux} \ |
191 | %{?with_skey:--with-skey} | |
60f3cbe5 | 192 | |
325b84c6 | 193 | %{__make} |
60f3cbe5 | 194 | |
195 | %install | |
196 | rm -rf $RPM_BUILD_ROOT | |
67f231a2 | 197 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{sudoers.d,pam.d,logrotate.d},/var/log/sudo-io,%{_mandir}/man8} |
3da66796 | 198 | |
af50df21 SS |
199 | %{__make} -j1 install \ |
200 | DESTDIR=$RPM_BUILD_ROOT \ | |
02cd30f3 ER |
201 | install_uid=$(id -u) \ |
202 | install_gid=$(id -g) \ | |
203 | sudoers_uid=$(id -u) \ | |
204 | sudoers_gid=$(id -g) | |
60f3cbe5 | 205 | |
63a8eea5 ER |
206 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/sudo |
207 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/pam.d/sudo-i | |
208 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/sudo | |
e39eae9c | 209 | |
213866f0 | 210 | touch $RPM_BUILD_ROOT/var/log/sudo |
60f3cbe5 | 211 | |
63a8eea5 | 212 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} |
7df1c00d | 213 | |
02cd30f3 ER |
214 | %if %{with ldap} |
215 | install -d $RPM_BUILD_ROOT%{schemadir} | |
9f41d987 | 216 | cp -p doc/schema.OpenLDAP $RPM_BUILD_ROOT%{schemadir}/sudo.schema |
02cd30f3 | 217 | %endif |
206acba3 | 218 | |
9f41d987 JB |
219 | # sudo,sudoers domains |
220 | %find_lang %{name} --all-name | |
221 | ||
60f3cbe5 | 222 | %clean |
223 | rm -rf $RPM_BUILD_ROOT | |
224 | ||
02cd30f3 ER |
225 | %post -n openldap-schema-sudo |
226 | %openldap_schema_register %{schemadir}/sudo.schema -d core | |
227 | %service -q ldap restart | |
63a8eea5 | 228 | %banner -o -e openldap-schema-sudo <<'EOF' |
02cd30f3 ER |
229 | NOTE: |
230 | In order for sudoRole LDAP queries to be efficient, the server must index | |
231 | the attribute 'sudoUser', e.g. | |
232 | ||
233 | # Indices to maintain | |
234 | index sudoUser eq | |
235 | EOF | |
02cd30f3 ER |
236 | |
237 | %postun -n openldap-schema-sudo | |
238 | if [ "$1" = "0" ]; then | |
239 | %openldap_schema_unregister %{schemadir}/sudo.schema | |
240 | %service -q ldap restart | |
241 | fi | |
242 | ||
67f231a2 ER |
243 | %triggerpostun -- %{name} < 1:1.7.8p2-5 |
244 | mv -f /var/run/sudo/* /var/db/sudo 2>/dev/null | |
d8cc0769 | 245 | rmdir /var/run/sudo 2>/dev/null || : |
67f231a2 | 246 | |
9f41d987 | 247 | %files -f %{name}.lang |
503af0bc | 248 | %defattr(644,root,root,755) |
9f41d987 JB |
249 | %doc ChangeLog NEWS README doc/{CONTRIBUTORS,HISTORY,LICENSE,TROUBLESHOOTING,UPGRADE,sample.*} |
250 | %{?with_ldap:%doc README.LDAP plugins/sudoers/sudoers2ldif} | |
d110a738 | 251 | %attr(550,root,root) %dir %{_sysconfdir}/sudoers.d |
50eae64a ER |
252 | %attr(440,root,root) %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/sudoers |
253 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo | |
d2bc6fd7 | 254 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/sudo-i |
7df1c00d JB |
255 | %attr(4755,root,root) %{_bindir}/sudo |
256 | %attr(4755,root,root) %{_bindir}/sudoedit | |
3da66796 | 257 | %attr(755,root,root) %{_bindir}/sudoreplay |
7df1c00d | 258 | %attr(755,root,root) %{_sbindir}/visudo |
bd33fb9b | 259 | %{?with_selinux:%attr(755,root,root) %{_libdir}/sesh} |
7df1c00d | 260 | %attr(755,root,root) %{_libdir}/sudo_noexec.so |
9f41d987 | 261 | %attr(755,root,root) %{_libdir}/sudoers.so |
ff6a027f | 262 | %{_mandir}/man5/sudoers.5* |
14b70151 | 263 | %{?with_ldap:%{_mandir}/man5/sudoers.ldap.5*} |
938895e3 | 264 | %{_mandir}/man8/sudo.8* |
9f41d987 | 265 | %{_mandir}/man8/sudo_plugin.8* |
ff6a027f | 266 | %{_mandir}/man8/sudoedit.8* |
3da66796 | 267 | %{_mandir}/man8/sudoreplay.8* |
ff6a027f | 268 | %{_mandir}/man8/visudo.8* |
7df1c00d | 269 | %attr(600,root,root) %ghost /var/log/sudo |
63a8eea5 | 270 | %attr(700,root,root) /var/log/sudo-io |
ff6a027f | 271 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/sudo |
67f231a2 | 272 | %attr(700,root,root) %dir /var/db/sudo |
02cd30f3 | 273 | |
9f41d987 JB |
274 | %files devel |
275 | %defattr(644,root,root,755) | |
276 | %{_includedir}/sudo_plugin.h | |
277 | ||
dd41247c | 278 | %if %{with ldap} |
02cd30f3 ER |
279 | %files -n openldap-schema-sudo |
280 | %defattr(644,root,root,755) | |
3587fdcd | 281 | %{schemadir}/sudo.schema |
dd41247c | 282 | %endif |