packages: nss_ldapd/nss_ldapd.spec - up to 0.7.0 - don't run daemon as root...

baggins baggins at pld-linux.org
Thu Sep 17 23:48:14 CEST 2009


Author: baggins                      Date: Thu Sep 17 21:48:14 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 0.7.0
- don't run daemon as root
- config file name has changed

---- Files affected:
packages/nss_ldapd:
   nss_ldapd.spec (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: packages/nss_ldapd/nss_ldapd.spec
diff -u packages/nss_ldapd/nss_ldapd.spec:1.4 packages/nss_ldapd/nss_ldapd.spec:1.5
--- packages/nss_ldapd/nss_ldapd.spec:1.4	Mon Jun 22 23:09:02 2009
+++ packages/nss_ldapd/nss_ldapd.spec	Thu Sep 17 23:48:09 2009
@@ -1,24 +1,27 @@
 # $Revision$, $Date$
 #
 # TODO:
-# - run daemon as non-root user
+# - consider name change
+# - add pam-pam_ldap package once the module will support all that PADL's one can
 #
 Summary:	LDAP Name Service Switch Module
 Summary(es.UTF-8):	Biblioteca NSS para LDAP
 Summary(pl.UTF-8):	Moduł NSS LDAP
 Summary(pt_BR.UTF-8):	Biblioteca NSS para LDAP
 Name:		nss_ldapd
-Version:	0.6.10
+Version:	0.7.0
 Release:	1
 License:	LGPL
 Group:		Base
-Source0:	http://arthurdejong.org/nss-ldapd/nss-ldapd-%{version}.tar.gz
-# Source0-md5:	4b351954d94aceadb74ce589640fc93b
+Source0:	http://arthurdejong.org/nss-ldapd/nss-pam-ldapd-%{version}.tar.gz
+# Source0-md5:	84487b422be438372b28621576700843
 Source1:	nslcd.init
+Patch0:		%{name}-no-root.patch
 URL:		http://arthurdejong.org/nss-ldapd/
 BuildRequires:	autoconf
 BuildRequires:	automake
 BuildRequires:	cyrus-sasl-devel
+BuildRequires:	heimdal-devel
 BuildRequires:	openldap-devel >= 2.4.6
 Requires(post,preun):	/sbin/chkconfig
 Requires:	rc-scripts >= 0.2.0
@@ -45,15 +48,13 @@
 do osobnego demona.
 
 %prep
-%setup -q -n nss-ldapd-%{version}
+%setup -q -n nss-pam-ldapd-%{version}
+%patch0 -p1
 
 %build
-%{__aclocal} -I m4
-%{__autoconf}
-%{__autoheader}
-%{__automake}
 %configure \
 	--with-ldap-lib=openldap
+
 %{__make}
 
 %install
@@ -68,6 +69,9 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+%useradd -u 21 -d /usr/share/empty -s /bin/false -c "NSS LDAP Cache Daemon User" -g nobody nslcd
+
 %post
 /sbin/ldconfig
 /sbin/chkconfig --add nslcd
@@ -79,11 +83,22 @@
 	/sbin/chkconfig --del nslcd
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+	%userremove nslcd
+fi
+
+%triggerpostun -- nss_ldapd < 0.7.0
+if [ -e %{_sysconfdir}/nss-ldapd.conf.rpmsave ]; then
+	mv -f %{_sysconfdir}/nslcd.conf{,rpmnew}
+	mv -f %{_sysconfdir}/nss-ldapd.conf.rpmsave %{_sysconfdir}/nslcd.conf
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README
 %attr(754,root,root) /etc/rc.d/init.d/nslcd
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nss-ldapd.conf
+%attr(640,nslcd,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nslcd.conf
 %attr(755,root,root) %{_libdir}/*.so*
 %attr(755,root,root) %{_sbindir}/nslcd
 %{_mandir}/man5/*
@@ -96,6 +111,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.5  2009/09/17 21:48:09  baggins
+- up to 0.7.0
+- don't run daemon as root
+- config file name has changed
+
 Revision 1.4  2009/06/22 21:09:02  zbyniu
 - up to 0.6.10
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nss_ldapd/nss_ldapd.spec?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list