Blame SPECS/nss-pam-ldapd.spec

6ce604
%global nssdir /%{_lib}
6ce604
%global pamdir /%{_lib}/security
6ce604
6ce604
%define _hardened_build 1
6ce604
6ce604
Name:           nss-pam-ldapd
6ce604
Version:        0.9.9
6ce604
Release:        3%{?dist}
6ce604
Summary:        An nsswitch module which uses directory servers
6ce604
License:        LGPLv2+
6ce604
URL:            http://arthurdejong.org/nss-pam-ldapd/
6ce604
Source0:        http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz
6ce604
Source1:        http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz.sig
6ce604
Source3:        nslcd.tmpfiles
6ce604
Source4:        nslcd.service
6ce604
6ce604
# Pylint tests fail w/o certain imports and are not needed for nslcd anyway,
6ce604
# plus, we don't ship the python utilities
6ce604
Patch0001:      0001-Disable-pylint-tests.patch
6ce604
Patch0002:      0002-Watch-for-uint32_t-overflows.patch
6ce604
6ce604
BuildRequires:  openldap-devel, krb5-devel
6ce604
BuildRequires:  autoconf, automake
6ce604
BuildRequires:  pam-devel
6ce604
BuildRequires:  systemd-units
6ce604
%{?systemd_requires}
6ce604
6ce604
# Pull in nscd, which is recommended.
6ce604
Recommends:     nscd
6ce604
6ce604
Obsoletes:      nss-ldapd < 0.7
6ce604
Provides:       nss-ldapd = %{version}-%{release}
6ce604
6ce604
# Obsolete PADL's nss_ldap
6ce604
Provides:       nss_ldap = 265-12
6ce604
Obsoletes:      nss_ldap < 265-11
6ce604
6ce604
# Obsolete PADL's pam_ldap
6ce604
Provides:       pam_ldap = 185-15
6ce604
Obsoletes:      pam_ldap < 185-15
6ce604
6ce604
%description
6ce604
The nss-pam-ldapd daemon, nslcd, uses a directory server to look up name
6ce604
service information (users, groups, etc.) on behalf of a lightweight
6ce604
nsswitch module.
6ce604
6ce604
%prep
6ce604
%autosetup -p1
6ce604
autoreconf -f -i
6ce604
6ce604
%build
6ce604
%configure --libdir=%{nssdir} \
6ce604
           --disable-utils \
6ce604
           --with-pam-seclib-dir=%{pamdir}
6ce604
%make_build
6ce604
6ce604
%check
6ce604
make check
6ce604
6ce604
%install
6ce604
rm -rf $RPM_BUILD_ROOT
6ce604
make install DESTDIR=$RPM_BUILD_ROOT
6ce604
mkdir -p $RPM_BUILD_ROOT/{%{_libdir},%{_unitdir}}
6ce604
install -p -m644 %{SOURCE4} $RPM_BUILD_ROOT/%{_unitdir}/
6ce604
6ce604
ln -s libnss_ldap.so.2 $RPM_BUILD_ROOT/%{nssdir}/libnss_ldap.so
6ce604
6ce604
sed -i -e 's,^uid.*,uid nslcd,g' -e 's,^gid.*,gid ldap,g' \
6ce604
$RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
6ce604
touch -r nslcd.conf $RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
6ce604
mkdir -p -m 0755 $RPM_BUILD_ROOT/var/run/nslcd
6ce604
mkdir -p -m 0755 $RPM_BUILD_ROOT/%{_tmpfilesdir}
6ce604
install -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf
6ce604
6ce604
%files
6ce604
%defattr(-,root,root)
6ce604
%doc AUTHORS ChangeLog COPYING HACKING NEWS README TODO
6ce604
%{_sbindir}/*
6ce604
%{nssdir}/*.so*
6ce604
%{pamdir}/pam_ldap.so
6ce604
%{_mandir}/*/*
6ce604
%attr(0600,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/nslcd.conf
6ce604
%attr(0644,root,root) %config(noreplace) %{_tmpfilesdir}/%{name}.conf
6ce604
%{_unitdir}/nslcd.service
6ce604
%attr(0775,nslcd,root) /var/run/nslcd
6ce604
6ce604
%pre
6ce604
getent group  ldap  > /dev/null || \
6ce604
/usr/sbin/groupadd -r -g 55 ldap
6ce604
getent passwd nslcd > /dev/null || \
6ce604
/usr/sbin/useradd -r -g ldap -c 'LDAP Client User' \
6ce604
    -u 65 -d / -s /sbin/nologin nslcd 2> /dev/null || :
6ce604
6ce604
%post
6ce604
# The usual stuff.
6ce604
/sbin/ldconfig
6ce604
%systemd_post nslcd.service
6ce604
6ce604
%preun
6ce604
%systemd_preun nslcd.service
6ce604
6ce604
%postun
6ce604
/sbin/ldconfig
6ce604
%systemd_postun_with_restart nslcd.service
6ce604
6ce604
%changelog
6ce604
* Wed May 30 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.9.9-3
6ce604
- Also change the pemissions on tmpfiles
6ce604
- Related: rhbz#1583211 - nslcd, the local LDAP daemon, fails to start
6ce604
                          with SELinux enabled
6ce604
6ce604
* Wed May 30 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.9.9-2
6ce604
- Apply a patch by Lukas Slebodnik to allow root to write to the
6ce604
  /var/run/nslcd directory
6ce604
- Resolves: rhbz#1583211 - nslcd, the local LDAP daemon, fails to start
6ce604
                           with SELinux enabled
6ce604
6ce604
* Sun Apr  1 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.9.9-1
6ce604
- Upgrade to the latest upstream
6ce604
  - Disable the python utilities
6ce604
  - Don't bother with failing pylint test as we don't ship the python
6ce604
    utilities
6ce604
- Drop unused validname and exitcode patches, port strtoid overflow
6ce604
  patch
6ce604
6ce604
* Sat Mar 31 2018 Jakub Hrozek <jhrozek@redhat.com> - 0.8.14-12
6ce604
- Get rid of all conditions that are always true for both EPEL-7 and Fedora
6ce604
  as it's quite unlikely we'd use this specfile on EPEL-6
6ce604
- Remove the sysvinit script and all the scriptlets around it
6ce604
- Unconditionally use systemd scriptlet macros and systemd_requires
6ce604
- Unconditionally build the PAM module as the PADL module is long dead
6ce604
- Remove the auto-migration of settings from nss_ldap as it's been
6ce604
  long gone from Fedora
6ce604
- Don't check /etc/sysconfig/authconfig as authconfig is on its way
6ce604
  out from Fedora
6ce604
- Use only spaces, not tabs, to stop my editor from looking like a
6ce604
  Christmas tree
6ce604
- Remove the obsolete Group stanza
6ce604
- Make nscd Recommended, not Required
6ce604
6ce604
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-11
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
6ce604
6ce604
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-10
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
6ce604
6ce604
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-9
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6ce604
6ce604
* Wed Feb  8 2017 Jakub Hrozek <jhrozek@redhat.com> 0.8.14-8
6ce604
- Apply a patch from Stanislav Moravec to fix nslcd return code
6ce604
6ce604
* Tue Mar 29 2016 Nalin Dahyabhai <nalin@redhat.com> 0.8.14-7
6ce604
- move the packaged tmpfiles.d file from /etc/tmpfiles.d to %%{_tmpfilesdir},
6ce604
  per heads-up from Ville Skyttä on devel@
6ce604
6ce604
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.14-6
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6ce604
6ce604
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.14-5
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6ce604
6ce604
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.14-4
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
6ce604
6ce604
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.14-3
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
6ce604
6ce604
* Wed May 07 2014 Nalin Dahyabhai <nalin@redhat.com> 0.8.14-2
6ce604
- where we check for USELDAP=yes in /etc/sysconfig/authconfig as an indication
6ce604
  of nss_ldap being in use, to decide whether to enable the nslcd service or
6ce604
  not, also check for USELDAPAUTH=yes, which indicates pam_ldap is being used
6ce604
6ce604
* Sat Oct 05 2013 Jakub Hrozek <jhrozek@redhat.com>  0.8.14-1
6ce604
- New upstream release 0.8.14
6ce604
- Remove upstreamed patches
6ce604
6ce604
* Sat Oct 05 2013 Jakub Hrozek <jhrozek@redhat.com>  0.8.13-4
6ce604
- Backport fixes for #1003011
6ce604
6ce604
* Sat Oct 05 2013 Jakub Hrozek <jhrozek@redhat.com>  0.8.13-3
6ce604
- Build with _hardened_build macro
6ce604
6ce604
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.13-2
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
6ce604
6ce604
* Mon May  6 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.13-1
6ce604
- update to 0.8.13
6ce604
- correct a syntax error in the fix that was added for #832706
6ce604
6ce604
* Tue Apr 30 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.12-4
6ce604
- in %%post, attempt to rewrite any instances of "map group uniqueMember ..."
6ce604
  to be "map group member ..." in nslcd.conf, as the attribute name changed
6ce604
  in 0.8.4 (via freeipa ticket #3589)
6ce604
6ce604
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.12-3
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
6ce604
6ce604
* Fri Jan 18 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.12-2
6ce604
- drop local patch to make the client flush some more read buffers
6ce604
6ce604
* Fri Jan 18 2013 Nalin Dahyabhai <nalin@redhat.com> 0.8.12-1
6ce604
- update to 0.8.12 (#846793)
6ce604
- make building pam_ldap conditional on the targeted release
6ce604
- add "After=named.service dirsrv.target slapd.service" to nslcd.service,
6ce604
  to make sure that nslcd is started after them if they're to be started
6ce604
  on the local system (#832706)
6ce604
- alter the versioned Obsoletes: on pam_ldap to include the F18 package
6ce604
- use %%{_unitdir} when deciding where to put systemd configuration, based
6ce604
  on patch from Václav Pavlín (#850232)
6ce604
- use new systemd macros for scriptlet hooks, when available, based on
6ce604
  patch from Václav Pavlín (#850232)
6ce604
6ce604
* Sun Sep 09 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.17-1
6ce604
- new upstream release 0.7.17
6ce604
6ce604
* Sun Aug 05 2012 Jakub Hrozek <jhrozek@redhat.com> - 0.7.16-5
6ce604
- Obsolete PADL's nss_ldap
6ce604
6ce604
* Sat Aug 04 2012 Jakub Hrozek <jhrozek@redhat.com> - 0.7.16-4
6ce604
- Build the PAM module, obsoletes PADL's pam-ldap (#856006)
6ce604
6ce604
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.16-3
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
6ce604
6ce604
* Mon May 14 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.16-2
6ce604
- backport upstream revision r1659 related to broken pipe when
6ce604
  requesting a large group
6ce604
- use grep -E instead of egrep to avoid rpmlint warnings
6ce604
6ce604
* Sat Apr 28 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.16-1
6ce604
- new upstream release 0.7.16
6ce604
6ce604
* Thu Mar 15 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.15-2
6ce604
- Do not print "Broken Pipe" error message when requesting a large group
6ce604
6ce604
* Fri Mar 9 2012 Jakub Hrozek <jhrozek@redhat.com> 0.7.15-1
6ce604
- new upstream release 0.7.15
6ce604
6ce604
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.14-3
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
6ce604
6ce604
* Fri Dec 16 2011 Jakub Hrozek <jhrozek@redhat.com> 0.7.14-2
6ce604
- Do not overflow large UID/GID values on 32bit architectures
6ce604
6ce604
* Mon Nov 28 2011 Nalin Dahyabhai <nalin@redhat.com>
6ce604
- use the same conditional test for deciding when to create the .so symlink as
6ce604
  we do later on for deciding when to include it in the package (#757004)
6ce604
6ce604
* Fri Sep 23 2011 Jakub Hrozek <jhrozek@redhat.com> 0.7.14-1
6ce604
- new upstream release 0.7.14
6ce604
- obsoletes nss-pam-ldapd-0.7.x-buffers.patch
6ce604
6ce604
* Wed Aug 24 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-8
6ce604
- include backported enhancement to take URIs in the form "dns:DOMAIN" in
6ce604
  addition to the already-implemented "dns" (#730309)
6ce604
6ce604
* Thu Jul 14 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-7
6ce604
- switch to only munging the contents of /etc/nslcd.conf on the very first
6ce604
  install (#706454)
6ce604
- make sure that we have enough space to parse any valid GID value when
6ce604
  parsing a user's primary GID (#716822)
6ce604
- backport support for the "validnames" option from SVN and use it to allow
6ce604
  parentheses characters by modifying the default setting (#690870), then
6ce604
  modify the default again to also allow shorter and shorter names to pass
6ce604
  muster (#706860)
6ce604
6ce604
* Wed Jul 13 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-6
6ce604
- convert to systemd-native startup (#716997)
6ce604
6ce604
* Mon Jun 13 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-5
6ce604
- change the file path Requires: we have for pam_ldap into a package name
6ce604
  Requires: (#601931)
6ce604
6ce604
* Wed Mar 30 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-4
6ce604
- tag nslcd.conf with %%verify(not md5 size mtime), since we always tweak
6ce604
  it in %%post (#692225)
6ce604
6ce604
* Tue Mar  1 2011 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-3
6ce604
- add a tmpfiles configuration to ensure that /var/run/nslcd is created when
6ce604
  /var/run is completely empty at boot (#656643)
6ce604
6ce604
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.13-2
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
6ce604
6ce604
* Mon Dec 13 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.13-1
6ce604
- update to 0.7.13
6ce604
6ce604
* Fri Oct 29 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.12-1
6ce604
- update to 0.7.12
6ce604
6ce604
* Fri Oct 15 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.11-1
6ce604
- update to 0.7.11
6ce604
6ce604
* Wed Sep 29 2010 jkeating - 0.7.10-2
6ce604
- Rebuilt for gcc bug 634757
6ce604
6ce604
* Fri Sep 24 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.10-1
6ce604
- update to 0.7.10
6ce604
6ce604
* Thu Sep 23 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.9-2
6ce604
- when creating /var/run/nslcd in the buildroot, specify that 0755 is a
6ce604
  permissions value and not another directory name (#636880)
6ce604
6ce604
* Mon Aug 30 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.9-1
6ce604
- update to 0.7.9
6ce604
6ce604
* Wed Aug 18 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.8-1
6ce604
- update to 0.7.8
6ce604
6ce604
* Wed Jul  7 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.7-1
6ce604
- update to 0.7.7
6ce604
6ce604
* Mon Jun 28 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.6-3
6ce604
- don't accidentally set multiple 'gid' settings in nslcd.conf, and try to
6ce604
  clean up after older versions of this package that did (#608314)
6ce604
6ce604
* Thu May 27 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.6-2
6ce604
- make inclusion of the .so symlink conditional on being on a sufficiently-
6ce604
  new Fedora where pam_ldap isn't part of the nss_ldap package, so having
6ce604
  this package conflict with nss_ldap doesn't require that pam_ldap be
6ce604
  removed (#596691)
6ce604
6ce604
* Thu May 27 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.6-1
6ce604
- update to 0.7.6
6ce604
6ce604
* Mon May 17 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.5-3
6ce604
- switch to the upstream patch for #592411
6ce604
6ce604
* Fri May 14 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.5-2
6ce604
- don't return an uninitialized buffer as the value for an optional attribute
6ce604
  that isn't present in the directory server entry (#592411)
6ce604
6ce604
* Fri May 14 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.5-1
6ce604
- update to 0.7.5
6ce604
6ce604
* Fri May 14 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.4-1
6ce604
- update to 0.7.4
6ce604
- stop trying to migrate retry timeout parameters from old ldap.conf files
6ce604
- add an explicit requires: on nscd to make sure it's at least available on
6ce604
  systems that are using nss-pam-ldapd; otherwise it's usually optional
6ce604
6ce604
* Tue Mar 23 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.3-1
6ce604
- update to 0.7.3
6ce604
6ce604
* Thu Feb 25 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.2-2
6ce604
- bump release for post-review commit
6ce604
6ce604
* Thu Feb 25 2010 Nalin Dahyabhai <nalin@redhat.com> 0.7.2-1
6ce604
- add comments about why we have a .so link at all, and not a -devel subpackage
6ce604
6ce604
* Wed Jan 13 2010 Nalin Dahyabhai <nalin@redhat.com>
6ce604
- obsolete/provides nss-ldapd
6ce604
- import configuration from nss-ldapd.conf, too
6ce604
6ce604
* Tue Jan 12 2010 Nalin Dahyabhai <nalin@redhat.com>
6ce604
- rename to nss-pam-ldapd
6ce604
- also check for import settings in /etc/nss_ldap.conf and /etc/pam_ldap.conf
6ce604
6ce604
* Thu Sep 24 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.11-2
6ce604
- rebuild
6ce604
6ce604
* Wed Sep 16 2009 Nalin Dahyabhai <nalin@redhat.com> 
6ce604
- apply Mitchell Berger's patch to clean up the init script, use %%{_initddir},
6ce604
  and correct the %%post so that it only thinks about turning on nslcd when
6ce604
  we're first being installed (#522947)
6ce604
- tell status() where the pidfile is when the init script is called for that
6ce604
6ce604
* Tue Sep  8 2009 Nalin Dahyabhai <nalin@redhat.com>
6ce604
- fix typo in a comment, capitalize the full name for "LDAP Client User" (more
6ce604
  from #516049)
6ce604
6ce604
* Wed Sep  2 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.11-1
6ce604
- update to 0.6.11
6ce604
6ce604
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.10-4
6ce604
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
6ce604
6ce604
* Thu Jun 18 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.10-3
6ce604
- update URL: and Source:
6ce604
6ce604
* Mon Jun 15 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.10-2
6ce604
- add and own /var/run/nslcd
6ce604
- convert hosts to uri during migration
6ce604
6ce604
* Thu Jun 11 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.10-1
6ce604
- update to 0.6.10
6ce604
6ce604
* Fri Apr 17 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.8-1
6ce604
- bump release number to 1 (part of #491767)
6ce604
- fix which group we check for during %%pre (part of #491767)
6ce604
6ce604
* Tue Mar 24 2009 Nalin Dahyabhai <nalin@redhat.com>
6ce604
- require chkconfig by package rather than path (Jussi Lehtola, part of #491767)
6ce604
6ce604
* Mon Mar 23 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.8-0.1
6ce604
- update to 0.6.8
6ce604
6ce604
* Mon Mar 23 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.7-0.1
6ce604
- start using a dedicated user
6ce604
6ce604
* Wed Mar 18 2009 Nalin Dahyabhai <nalin@redhat.com> 0.6.7-0.0
6ce604
- initial package (#445965)