1 |
%define libname %mklibname %{name} 0 |
2 |
%define develname %mklibname %{name} -d |
3 |
|
4 |
%define with_prelude 0 |
5 |
%{?_without_prelude: %{expand: %%global with_prelude 0}} |
6 |
%{?_with_prelude: %{expand: %%global with_prelude 1}} |
7 |
|
8 |
%define bootstrap 0 |
9 |
%{?_without_bootstrap: %global bootstrap 0} |
10 |
%{?_with_bootstrap: %global bootstrap 1} |
11 |
|
12 |
%define pam_redhat_version 0.99.11 |
13 |
|
14 |
Summary: A security tool which provides authentication for applications |
15 |
Name: pam |
16 |
Version: 1.1.8 |
17 |
Release: %mkrel 8 |
18 |
# The library is BSD licensed with option to relicense as GPLv2+ - this option is redundant |
19 |
# as the BSD license allows that anyway. pam_timestamp and pam_console modules are GPLv2+, |
20 |
License: BSD and GPLv2+ |
21 |
Group: System/Libraries |
22 |
Url: http://www.linux-pam.org/ |
23 |
Source0: http://www.linux-pam.org/library/Linux-PAM-%{version}.tar.bz2 |
24 |
Source1: %{name}-tmpfiles.conf |
25 |
Source2: pam-redhat-%{pam_redhat_version}.tar.bz2 |
26 |
Source5: other.pamd |
27 |
Source6: system-auth.pamd |
28 |
Source7: config-util.pamd |
29 |
Source8: dlopen.sh |
30 |
Source9: system-auth.5 |
31 |
Source10: config-util.5 |
32 |
Source11: 20-nproc.conf |
33 |
Source12: postlogin.pamd |
34 |
Source13: postlogin.5 |
35 |
|
36 |
# RedHat patches |
37 |
Patch1: pam-1.0.90-redhat-modules.patch |
38 |
Patch2: pam-1.1.6-std-noclose.patch |
39 |
Patch4: pam-1.1.0-console-nochmod.patch |
40 |
Patch5: pam-1.1.0-notally.patch |
41 |
Patch9: pam-1.1.6-noflex.patch |
42 |
Patch10: pam-1.1.3-nouserenv.patch |
43 |
Patch13: pam-1.1.5-limits-user.patch |
44 |
Patch22: pam-1.1.7-unix-build.patch |
45 |
Patch32: pam-1.1.7-tty-audit-init.patch |
46 |
Patch35: pam-1.1.8-cve-2013-7041.patch |
47 |
Patch36: pam-1.1.8-cve-2014-2583.patch |
48 |
|
49 |
# Mageia specific sources/patches |
50 |
# (fl) fix infinite loop |
51 |
Patch507: pam-0.74-loop.patch |
52 |
# (fc) don't complain when / is owned by root.adm |
53 |
Patch508: Linux-PAM-0.99.3.0-pamtimestampadm.patch |
54 |
# (fl) pam_xauth: set extra groups because in high security levels |
55 |
# access to /usr/X11R6/bin dir is controlled by a group |
56 |
Patch512: Linux-PAM-1.1.1-xauth-groups.patch |
57 |
# (blino) fix parallel build (pam_console) |
58 |
Patch521: Linux-PAM-0.99.3.0-pbuild-rh.patch |
59 |
|
60 |
Patch700: pam_fix_static_pam_console.patch |
61 |
# (fc) do not output error when no file is in /etc/security/console.perms.d/ |
62 |
Patch701: pam-1.1.0-console-nopermsd.patch |
63 |
# (peroyvind): add missing constant that went with rpc removal from glibc 2.14 |
64 |
Patch702: Linux-PAM-1.1.4-add-now-missing-nis-constant.patch |
65 |
|
66 |
#add missing documentation |
67 |
Source501: pam_tty_audit.8 |
68 |
Source502: README |
69 |
Requires(pre): filesystem >= 2.1.9-18 |
70 |
Requires(posttrans): systemd >= %{systemd_required_version} |
71 |
Requires: cracklib-dicts |
72 |
Requires: setup >= 2.7.12-2 |
73 |
Requires: pam_tcb >= 1.0.2-16 |
74 |
Conflicts: initscripts < 3.94 |
75 |
Requires(pre): rpm-helper |
76 |
Requires(posttrans): coreutils |
77 |
Requires(posttrans): tcb >= 1.0.2-16 |
78 |
BuildRequires: bison |
79 |
BuildRequires: cracklib-devel |
80 |
BuildRequires: flex |
81 |
%if !%{bootstrap} |
82 |
# this pulls in the mega texlive load |
83 |
BuildRequires: linuxdoc-tools |
84 |
%endif |
85 |
BuildRequires: db5_nss-devel |
86 |
BuildRequires: openssl-devel |
87 |
BuildRequires: libaudit-devel |
88 |
BuildRequires: glibc-crypt_blowfish-devel |
89 |
BuildRequires: gettext-devel |
90 |
%if %with_prelude |
91 |
BuildRequires: prelude-devel >= 0.9.0 |
92 |
%else |
93 |
BuildConflicts: prelude-devel |
94 |
%endif |
95 |
|
96 |
%description |
97 |
PAM (Pluggable Authentication Modules) is a system security tool that |
98 |
allows system administrators to set authentication policy without |
99 |
having to recompile programs that handle authentication. |
100 |
|
101 |
%package doc |
102 |
Summary: Additional documentation for %{name} |
103 |
Group: System/Libraries |
104 |
Requires: %{name} = %{version} |
105 |
BuildArch: noarch |
106 |
|
107 |
%description doc |
108 |
PAM (Pluggable Authentication Modules) is a system security tool that |
109 |
allows system administrators to set authentication policy without |
110 |
having to recompile programs that handle authentication. |
111 |
|
112 |
This is the documentation package of %{name}. |
113 |
|
114 |
%package -n %{libname} |
115 |
Summary: Libraries for %{name} |
116 |
Group: System/Libraries |
117 |
Requires(pre): filesystem >= 2.1.9-18 |
118 |
|
119 |
%description -n %{libname} |
120 |
PAM (Pluggable Authentication Modules) is a system security tool that |
121 |
allows system administrators to set authentication policy without |
122 |
having to recompile programs that handle authentication. |
123 |
|
124 |
This package contains the librairies for %{name}. |
125 |
|
126 |
%package -n %{develname} |
127 |
Summary: Development headers and libraries for %{name} |
128 |
Group: Development/Other |
129 |
Requires(pre): filesystem >= 2.1.9-18 |
130 |
Requires: %{libname} = %{version} |
131 |
Provides: %{name}-devel = %{version}-%{release} |
132 |
Provides: lib%{name}-devel = %{version}-%{release} |
133 |
|
134 |
%description -n %{develname} |
135 |
PAM (Pluggable Authentication Modules) is a system security tool that |
136 |
allows system administrators to set authentication policy without |
137 |
having to recompile programs that handle authentication. |
138 |
|
139 |
This package contains the development librairies for %{name}. |
140 |
|
141 |
%prep |
142 |
%setup -q -n Linux-PAM-%{version} -a 2 |
143 |
|
144 |
# Add custom modules. |
145 |
mv pam-redhat-%{pam_redhat_version}/* modules |
146 |
|
147 |
# (RH) |
148 |
%patch1 -p1 -b .redhat-modules |
149 |
%patch2 -p1 -b .std-noclose |
150 |
%patch4 -p1 -b .nochmod |
151 |
%patch5 -p1 -b .notally |
152 |
%patch9 -p1 -b .noflex |
153 |
%patch10 -p1 -b .nouserenv |
154 |
%patch13 -p1 -b .limits |
155 |
%patch22 -p1 -b .build |
156 |
%patch32 -p1 -b .tty-audit-init |
157 |
%patch35 -p1 -b .case |
158 |
%patch36 -p1 -b .timestamp-ruser |
159 |
|
160 |
# (Mageia) |
161 |
%patch507 -p1 -b .loop |
162 |
%patch508 -p1 -b .pamtimestampadm |
163 |
%patch512 -p0 -b .xauth-groups |
164 |
%patch521 -p1 -b .pbuild-rh |
165 |
%patch700 -p1 -b .static |
166 |
%patch701 -p1 -b .nopermsd |
167 |
%patch702 -p1 -b .nis-const |
168 |
|
169 |
# 08/08/2008 - vdanen - make pam provide pam_unix until we can work out all the issues in pam_tcb; this |
170 |
# just makes things easier but is not meant to be a permanent solution |
171 |
## Remove unwanted modules; pam_tcb provides pam_unix now |
172 |
#for d in pam_unix; do |
173 |
# rm -rf modules/$d |
174 |
# sed -i "s,modules/$d/Makefile,," configure.in |
175 |
# sed -i "s/ $d / /" modules/Makefile.am |
176 |
#done |
177 |
|
178 |
|
179 |
install -m644 %{SOURCE501} %{SOURCE502} modules/pam_tty_audit/ |
180 |
|
181 |
mkdir -p doc/txts |
182 |
for readme in modules/pam_*/README ; do |
183 |
cp -f ${readme} doc/txts/README.`dirname ${readme} | sed -e 's|^modules/||'` |
184 |
done |
185 |
|
186 |
%build |
187 |
autoreconf -fi -I m4 |
188 |
|
189 |
export BROWSER="" |
190 |
CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{_includedir}/db_nss -D_GNU_SOURCE" \ |
191 |
%configure2_5x \ |
192 |
--includedir=%{_includedir}/security \ |
193 |
--with-db-uniquename=_nss \ |
194 |
--docdir=%{_docdir}/%{name} \ |
195 |
--disable-selinux |
196 |
%make |
197 |
|
198 |
%install |
199 |
mkdir -p %{buildroot}%{_includedir}/security |
200 |
mkdir -p %{buildroot}%{_libdir}/security |
201 |
%makeinstall_std LDCONFIG=: |
202 |
install -d -m 755 %{buildroot}/etc/pam.d |
203 |
install -m 644 %{SOURCE5} %{buildroot}/etc/pam.d/other |
204 |
install -m 644 %{SOURCE6} %{buildroot}/etc/pam.d/system-auth |
205 |
install -m 644 %{SOURCE7} %{buildroot}/etc/pam.d/config-util |
206 |
install -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/security/limits.d/20-nproc.conf |
207 |
install -m 644 %{SOURCE12} %{buildroot}/etc/pam.d/postlogin |
208 |
install -m 600 /dev/null %{buildroot}%{_sysconfdir}/security/opasswd |
209 |
install -d -m 755 %{buildroot}/var/log |
210 |
install -m 600 /dev/null %{buildroot}/var/log/tallylog |
211 |
|
212 |
# Install man pages. |
213 |
install -m 644 %{SOURCE9} %{SOURCE10} %{SOURCE13} %{buildroot}%{_mandir}/man5/ |
214 |
|
215 |
# Install tmpfiles |
216 |
install -D -p -m 644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf |
217 |
|
218 |
# remove unpackaged .la files |
219 |
rm -rf %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/security/*.la |
220 |
|
221 |
# no longer needed, handled by ACL in udev |
222 |
for phase in auth acct passwd session ; do |
223 |
ln -sf pam_unix.so %{buildroot}%{_libdir}/security/pam_unix_${phase}.so |
224 |
done |
225 |
|
226 |
%find_lang Linux-PAM |
227 |
|
228 |
%check |
229 |
# (blino) we don't want to test if SE Linux is built, it's disabled |
230 |
# Make sure every module subdirectory gave us a module. Yes, this is hackish. |
231 |
for dir in modules/pam_* ; do |
232 |
if [ -d ${dir} ] && [ ${dir} != "modules/pam_selinux" && [ ${dir} != "modules/pam_sepermit" ]; then |
233 |
[ ${dir} = "modules/pam_tally" ] && continue |
234 |
if ! ls -1 %{buildroot}%{_libdir}/security/`basename ${dir}`*.so ; then |
235 |
echo ERROR `basename ${dir}` did not build a module. |
236 |
exit 1 |
237 |
fi |
238 |
fi |
239 |
done |
240 |
|
241 |
# Check for module problems. Specifically, check that every module we just |
242 |
# installed can actually be loaded by a minimal PAM-aware application. |
243 |
%{_sbindir}/ldconfig -n %{buildroot}%{_libdir} |
244 |
for module in %{buildroot}%{_libdir}/security/pam*.so ; do |
245 |
if ! env LD_LIBRARY_PATH=%{buildroot}%{_libdir} \ |
246 |
%{SOURCE8} -ldl -lpam -L%{buildroot}%{_libdir} ${module} ; then |
247 |
echo ERROR module: ${module} cannot be loaded. |
248 |
exit 1 |
249 |
fi |
250 |
done |
251 |
|
252 |
rmdir %{buildroot}/var/run/console |
253 |
|
254 |
%posttrans |
255 |
%_tmpfilescreate %{name} |
256 |
# (cg) Ensure that the pam_systemd.so is included for user ACLs under systemd |
257 |
# Note: Only affects upgrades, but does no harm so always update if needed. |
258 |
if ! grep -q "pam_systemd\.so" /etc/pam.d/system-auth; then |
259 |
echo "-session optional pam_systemd.so" >>/etc/pam.d/system-auth |
260 |
fi |
261 |
|
262 |
if [ ! -a /var/log/tallylog ] ; then |
263 |
install -m 600 /dev/null /var/log/tallylog |
264 |
fi |
265 |
if [ -f /etc/login.defs ] && ! grep -q USE_TCB /etc/login.defs; then |
266 |
%{_sbindir}/set_tcb --auto --migrate |
267 |
fi |
268 |
|
269 |
|
270 |
%files -f Linux-PAM.lang |
271 |
%doc NEWS |
272 |
%docdir %{_docdir}/%{name} |
273 |
%dir /etc/pam.d |
274 |
%config(noreplace) /etc/environment |
275 |
%config(noreplace) /etc/pam.d/other |
276 |
%attr(0644,root,shadow) %config(noreplace) /etc/pam.d/system-auth |
277 |
%config(noreplace) /etc/pam.d/config-util |
278 |
%config(noreplace) /etc/pam.d/postlogin |
279 |
%{_sbindir}/mkhomedir_helper |
280 |
%{_sbindir}/pam_console_apply |
281 |
%{_sbindir}/pam_tally2 |
282 |
%{_sbindir}/unix_chkpwd |
283 |
%{_sbindir}/unix_update |
284 |
%attr(4755,root,root) %{_sbindir}/pam_timestamp_check |
285 |
%{_tmpfilesdir}/%{name}.conf |
286 |
%config(noreplace) %{_sysconfdir}/security/access.conf |
287 |
%config(noreplace) %{_sysconfdir}/security/chroot.conf |
288 |
%config(noreplace) %{_sysconfdir}/security/console.perms |
289 |
%config(noreplace) %{_sysconfdir}/security/console.handlers |
290 |
%config(noreplace) %{_sysconfdir}/security/group.conf |
291 |
%config(noreplace) %{_sysconfdir}/security/limits.conf |
292 |
%dir %{_sysconfdir}/security/limits.d |
293 |
%config(noreplace) %{_sysconfdir}/security/limits.d/90-nproc.conf |
294 |
%config(noreplace) %{_sysconfdir}/security/namespace.conf |
295 |
%attr(755,root,root) %config(noreplace) %{_sysconfdir}/security/namespace.init |
296 |
%config(noreplace) %{_sysconfdir}/security/pam_env.conf |
297 |
%config(noreplace) %{_sysconfdir}/security/time.conf |
298 |
%config(noreplace) %{_sysconfdir}/security/opasswd |
299 |
%dir %{_sysconfdir}/security/console.apps |
300 |
%dir %{_sysconfdir}/security/console.perms.d |
301 |
%ghost %verify(not md5 size mtime) /var/log/tallylog |
302 |
%{_mandir}/man5/* |
303 |
%{_mandir}/man8/* |
304 |
|
305 |
%files -n %{libname} |
306 |
%{_libdir}/libpam.so.* |
307 |
%{_libdir}/libpamc.so.* |
308 |
%{_libdir}/libpam_misc.so.* |
309 |
%{_libdir}/security/*.so |
310 |
%{_libdir}/security/pam_filter |
311 |
%dir %{_libdir}/security |
312 |
|
313 |
%files -n %{develname} |
314 |
%doc Copyright |
315 |
%{_libdir}/libpam.so |
316 |
%{_libdir}/libpam_misc.so |
317 |
%{_libdir}/libpamc.so |
318 |
%{_includedir}/security/*.h |
319 |
%{_mandir}/man3/* |
320 |
|
321 |
%files doc |
322 |
%doc doc/txts doc/specs/rfc86.0.txt Copyright |