[Pkg-openldap-devel] r671 - in openldap/trunk-2.3/debian: . lintian-overrides patches

Matthijs Mohlmann active2-guest at costa.debian.org
Sat Jun 3 23:34:36 UTC 2006


Author: active2-guest
Date: 2006-06-03 23:34:35 +0000 (Sat, 03 Jun 2006)
New Revision: 671

Modified:
   openldap/trunk-2.3/debian/changelog
   openldap/trunk-2.3/debian/control
   openldap/trunk-2.3/debian/lintian-overrides/ldap-utils
   openldap/trunk-2.3/debian/lintian-overrides/slapd
   openldap/trunk-2.3/debian/patches/add-autogen-sh
   openldap/trunk-2.3/debian/patches/libldap-makefile_in
   openldap/trunk-2.3/debian/patches/man-slapd
   openldap/trunk-2.3/debian/patches/ntlm-ldap_h-hack
   openldap/trunk-2.3/debian/patches/ntlm_c
   openldap/trunk-2.3/debian/patches/slurpd-in-spool
   openldap/trunk-2.3/debian/patches/use-lpthreads
   openldap/trunk-2.3/debian/slapd.postinst
   openldap/trunk-2.3/debian/slapd.scripts-common
Log:
 * Removed svn:executable property from the patches.
 * Added dependency on adduser for slapd.
 * Updated the lintian overrides.
 * Create dynamically the directories /var/lib/ldap, /var/spool/slurpd and
   /var/run/slapd
 * Fixed logic of update_permissions and create_ldap_directories.


Modified: openldap/trunk-2.3/debian/changelog
===================================================================
--- openldap/trunk-2.3/debian/changelog	2006-06-02 20:48:41 UTC (rev 670)
+++ openldap/trunk-2.3/debian/changelog	2006-06-03 23:34:35 UTC (rev 671)
@@ -4,8 +4,9 @@
   * Patches by Quanah Gibson-Mount
     - Patch to fix a lock bug with a virtual root entry in the BDB backend.
     - Patch to fix boolean logic in the overlays.
+  * Add dependency on adduser.
 
- -- Matthijs Mohlmann <matthijs at cacholong.nl>  Fri,  2 Jun 2006 22:45:58 +0200
+ -- Matthijs Mohlmann <matthijs at cacholong.nl>  Sat,  3 Jun 2006 18:05:38 +0200
 
 openldap2.3 (2.3.24-1) unstable; urgency=low
 

Modified: openldap/trunk-2.3/debian/control
===================================================================
--- openldap/trunk-2.3/debian/control	2006-06-02 20:48:41 UTC (rev 670)
+++ openldap/trunk-2.3/debian/control	2006-06-03 23:34:35 UTC (rev 671)
@@ -12,7 +12,7 @@
 Priority: optional
 Architecture: any
 Pre-Depends: debconf (>= 0.5) | debconf-2.0
-Depends: ${shlibs:Depends}, coreutils (>= 4.5.1-1) | fileutils (>= 4.0i-1), psmisc, perl (>> 5.8.0) | libmime-base64-perl, libldap-2.3-0 (= ${Source-Version})
+Depends: ${shlibs:Depends}, coreutils (>= 4.5.1-1) | fileutils (>= 4.0i-1), psmisc, perl (>> 5.8.0) | libmime-base64-perl, libldap-2.3-0 (= ${Source-Version}), adduser
 Recommends: db4.2-util, libsasl2-modules
 Suggests: ldap-utils
 Conflicts: umich-ldapd, ldap-server, libbind-dev, bind-dev, libltdl3 (= 1.5.4-1)

Modified: openldap/trunk-2.3/debian/lintian-overrides/ldap-utils
===================================================================
--- openldap/trunk-2.3/debian/lintian-overrides/ldap-utils	2006-06-02 20:48:41 UTC (rev 670)
+++ openldap/trunk-2.3/debian/lintian-overrides/ldap-utils	2006-06-03 23:34:35 UTC (rev 671)
@@ -1,3 +1,3 @@
 # dh_shlibdeps is not smart enough to wipe additional relations. Since this
 # is not easy to fix we don't even try to do it at this time.  -- Torsten
-ldap-utils: package-has-a-duplicate-relation depends: libldap-2.3-0, libldap-2.3-0 (= 2.3.24-1)
+ldap-utils: package-has-a-duplicate-relation depends: libldap-2.3-0, libldap-2.3-0 (= 2.3.24-2)

Modified: openldap/trunk-2.3/debian/lintian-overrides/slapd
===================================================================
--- openldap/trunk-2.3/debian/lintian-overrides/slapd	2006-06-02 20:48:41 UTC (rev 670)
+++ openldap/trunk-2.3/debian/lintian-overrides/slapd	2006-06-03 23:34:35 UTC (rev 671)
@@ -5,7 +5,7 @@
 
 # dh_shlibdeps is not smart enough to wipe additional relations. Since this
 # is not easy to fix we don't even try to do it at this time.  -- Torsten
-slapd: package-has-a-duplicate-relation depends: libldap-2.3-0, libldap-2.3-0 (= 2.3.24-1)
+slapd: package-has-a-duplicate-relation depends: libldap-2.3-0, libldap-2.3-0 (= 2.3.24-2)
 
 # The extended description is needed in slapd/backend. It explains a lot about
 # the different backends.


Property changes on: openldap/trunk-2.3/debian/patches/add-autogen-sh
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: openldap/trunk-2.3/debian/patches/libldap-makefile_in
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: openldap/trunk-2.3/debian/patches/man-slapd
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: openldap/trunk-2.3/debian/patches/ntlm-ldap_h-hack
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: openldap/trunk-2.3/debian/patches/ntlm_c
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: openldap/trunk-2.3/debian/patches/slurpd-in-spool
___________________________________________________________________
Name: svn:executable
   - *


Property changes on: openldap/trunk-2.3/debian/patches/use-lpthreads
___________________________________________________________________
Name: svn:executable
   - *

Modified: openldap/trunk-2.3/debian/slapd.postinst
===================================================================
--- openldap/trunk-2.3/debian/slapd.postinst	2006-06-02 20:48:41 UTC (rev 670)
+++ openldap/trunk-2.3/debian/slapd.postinst	2006-06-03 23:34:35 UTC (rev 671)
@@ -54,7 +54,9 @@
 # }}}
 
 # Create a new user
-create_new_user
+if [ "$MODE" = "configure" ]; then
+	create_new_user
+fi
 
 # Configuration.
 if is_initial_configuration "$@"; then

Modified: openldap/trunk-2.3/debian/slapd.scripts-common
===================================================================
--- openldap/trunk-2.3/debian/slapd.scripts-common	2006-06-02 20:48:41 UTC (rev 670)
+++ openldap/trunk-2.3/debian/slapd.scripts-common	2006-06-03 23:34:35 UTC (rev 671)
@@ -132,34 +132,39 @@
 
 # }}}
 create_new_user() { # {{{
-	if [ "$MODE" = "configure" ]; then
-		if [ -z "`getent group openldap`" ]; then
-			addgroup --quiet --system openldap
-		fi
-		if [ -z "`getent passwd openldap`" ]; then
-			echo -n "  Creating new user openldap " >&2
-			adduser --quiet --system --home /var/lib/ldap --shell /bin/false --ingroup openldap --disabled-password --disabled-login --gecos "OpenLDAP" openldap
-			echo "done." >&2
-		fi
+	if [ -z "`getent group openldap`" ]; then
+		addgroup --quiet --system openldap
 	fi
+	if [ -z "`getent passwd openldap`" ]; then
+		echo -n "  Creating new user openldap " >&2
+		adduser --quiet --system --home /var/lib/ldap --shell /bin/false \
+        --ingroup openldap --disabled-password --disabled-login \
+        --gecos "OpenLDAP Server Account" openldap
+		echo "done." >&2
+	fi
 }
 # }}}
 create_ldap_directories() {	# {{{
-	if [ ! -d /var/lib/ldap && ! -z $SLAPD_USER && ! -z $SLAPD_GROUP ]; then
-		mkdir /var/lib/ldap
+	if [ ! -d /var/lib/ldap ]; then
+		mkdir -m 0700 /var/lib/ldap
 	fi
-	if [ ! -d /var/spool/slurpd && ! -z $SLAPD_USER && ! -z $SLAPD_GROUP ]; then
-		mkdir /var/spool/slurpd
+	if [ ! -d /var/spool/slurpd ]; then
+		mkdir -m 0700 /var/spool/slurpd
 	fi
+	if [ ! -d /var/run/slapd ]; then
+		mkdir -m 0755 /var/run/slapd
+	fi
+	update_permissions /var/lib/ldap
+	update_permissions /var/spool/slurpd
+	update_permissions /var/run/slapd
 }
 # }}}
 update_permissions() {	# {{{
-	if [ -d /var/lib/ldap && ! -z $SLAPD_USER && ! -z $SLAPD_GROUP ]; then
-		chown -R $SLAPD_USER:$SLAPD_GROUP /var/lib/ldap
+	dir="$1"
+	if [ -d "$dir" ]; then
+		[ -z "$SLAPD_USER" ] || chown -R "$SLAPD_USER" "$dir"
+		[ -z "$SLAPD_GROUP" ] || chgrp -R "$SLAPD_GROUP" "$dir"
 	fi
-	if [ -d /var/spool/slurpd && ! -z $SLAPD_USER && ! -z $SLAPD_GROUP ]; then
-		chown -R $SLAPD_USER:$SLAPD_GROUP /var/spool/slurpd
-	fi
 }
 # }}}
 # }}}
@@ -546,20 +551,19 @@
 	backend="`echo $RET|tr A-Z a-z`"
 
 	# Looks like the following code is not needed as slapd is unconfigured
-	# first and stopped at that time.
-	# Make sure the daemon is shut down when doing a reconfigure.  No
-	# daemon should be running during an initial install.
-	# XXX: Shouldn't we stop and start slapd at the outer level?
-	#if [ "$1" = reconfigure ] || [ "$DEBCONF_RECONFIGURE" ]; then
-	#	invoke-rc.d slapd stop
-	#fi
+	# first and stopped at that time. So no need to stop slapd at all here.
 
 	if [ -e "/var/lib/ldap" ] && ! is_empty_dir /var/lib/ldap; then
 		echo >&2 "  Moving old database directory to /var/backups:"
 		move_old_database_away /var/lib/ldap
 	fi
 	create_new_slapd_conf "$basedn" "$backend"
+	create_ldap_directories
 	create_new_directory "$basedn" "$dc"
+
+	# Put the right permissions on this directory.
+	update_permissions /var/lib/ldap
+
   # Now that we created the new directory we don't need the passwords in the
   # debconf database anymore. So wipe them.
   wipe_admin_pass
@@ -862,6 +866,9 @@
 	# Make sure we keep the permissions of an old slapd.conf
 	if [ -e "$SLAPD_CONF" ]; then
 		assign_permissions "$SLAPD_CONF" "$conf_new"
+	else
+		[ -z "$SLAPD_USER" ] || chown "$SLAPD_USER" "$conf_new"
+		[ -z "$SLAPD_GROUP" ] || chgrp "$SLAPD_GROUP" "$conf_new"
 	fi
 	mv "$conf_new" "$SLAPD_CONF"
 }




More information about the Pkg-openldap-devel mailing list