[openldap] patch slapd to skip empty arguments

jvcelak jvcelak at fedoraproject.org
Tue Nov 1 14:40:21 UTC 2011


commit a0c545d1a7cbbdea788ddf6eec99055d281c82aa
Author: Jan Vcelak <jvcelak at redhat.com>
Date:   Thu Oct 27 17:09:20 2011 +0200

    patch slapd to skip empty arguments
    
    This is required by systemd, as variable expansion works there different
    than in shell. Empty SLAPD_OPTIONS in environment file would not work.
    
    (The patch is Fedora specific.)

 openldap-fedora-systemd.patch |   22 ++++++++++++++++++++++
 openldap.spec                 |    5 +++++
 2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/openldap-fedora-systemd.patch b/openldap-fedora-systemd.patch
new file mode 100644
index 0000000..3d2dcce
--- /dev/null
+++ b/openldap-fedora-systemd.patch
@@ -0,0 +1,22 @@
+Skip any empty parameters when parsing command line options.
+This is required because systemd does not expand variables the same way as shell does,
+we need it because of an empty SLAPD_OPTIONS in environment file.
+
+Fedora specific patch.
+
+Author: Jan Vcelak <jvcelak at redhat.com>
+
+diff -uNPrp openldap-2.4.26/servers/slapd/main.c openldap-2.4.26.fix/servers/slapd/main.c
+--- openldap-2.4.26/servers/slapd/main.c	2011-06-30 17:13:36.000000000 +0200
++++ openldap-2.4.26.fix/servers/slapd/main.c	2011-10-27 17:05:02.641066298 +0200
+@@ -682,6 +682,10 @@ unhandled_option:;
+ 		}
+ 	}
+ 
++	/* skip empty parameters */
++	while ( optind < argc && *argv[optind] == '\0' )
++		optind += 1;
++
+ 	if ( optind != argc )
+ 		goto unhandled_option;
+ 
diff --git a/openldap.spec b/openldap.spec
index 7685d24..e6f4c84 100644
--- a/openldap.spec
+++ b/openldap.spec
@@ -44,6 +44,9 @@ Patch17: openldap-man-ldap-sync.patch
 Patch18: openldap-nss-handshake-threadsafe.patch
 Patch19: openldap-syncrepl-unset-tls-options.patch
 
+# Fedora specific patches
+Patch100: openldap-fedora-systemd.patch
+
 # patches for the evolution library (see README.evolution)
 Patch200: openldap-evolution-ntlm.patch
 
@@ -153,6 +156,8 @@ pushd openldap-%{version}
 %patch18 -p1 -b .nss-handshake-threadsafe
 %patch19 -p1 -b .syncrepl-unset-tls-options
 
+%patch100 -p1 -b .fedora-systemd
+
 cp %{_datadir}/libtool/config/config.{sub,guess} build/
 
 for subdir in build-servers build-clients ; do


More information about the scm-commits mailing list