[Checkins] SVN: z3c.recipe.ldap/trunk/z3c/recipe/ldap/ Escape socket paths

Ross Patterson me at rpatterson.net
Mon Dec 10 17:24:54 EST 2007


Log message for revision 82247:
  Escape socket paths
  

Changed:
  U   z3c.recipe.ldap/trunk/z3c/recipe/ldap/docs/README.txt
  U   z3c.recipe.ldap/trunk/z3c/recipe/ldap/slapd.py

-=-
Modified: z3c.recipe.ldap/trunk/z3c/recipe/ldap/docs/README.txt
===================================================================
--- z3c.recipe.ldap/trunk/z3c/recipe/ldap/docs/README.txt	2007-12-10 18:54:55 UTC (rev 82246)
+++ z3c.recipe.ldap/trunk/z3c/recipe/ldap/docs/README.txt	2007-12-10 22:24:53 UTC (rev 82247)
@@ -84,6 +84,14 @@
     dbconfig	set_lg_bsize	2097152
     index	objectClass	eq
 
+The socket path is properly escaped in the configuration::
+
+    >>> cat(sample_buildout, '.installed.cfg')
+    [buildout]...
+    [slapd]...
+    urls = ldapi://...%2Fsample-buildout%2Fparts%2Fslapd%2Fslapd.socket
+    ...
+
 An empty directory is created for the LDAP database::
 
     >>> ls(sample_buildout, 'var')
@@ -109,11 +117,13 @@
     -  DB_CONFIG
     -  __db.001...
 
-While the server is running a pid file is created::
+While the server is running a pid file is created and also a socket in
+this case::
 
     >>> ls(sample_buildout, 'parts', 'slapd')
     -  slapd.conf
     -  slapd.pid
+    -  slapd.socket
 
 Stop the slapd server::
 

Modified: z3c.recipe.ldap/trunk/z3c/recipe/ldap/slapd.py
===================================================================
--- z3c.recipe.ldap/trunk/z3c/recipe/ldap/slapd.py	2007-12-10 18:54:55 UTC (rev 82246)
+++ z3c.recipe.ldap/trunk/z3c/recipe/ldap/slapd.py	2007-12-10 22:24:53 UTC (rev 82247)
@@ -40,8 +40,9 @@
             raise ValueError('Cannot specify both the "urls" and '
                              '"use-socket" options') 
         if 'use-socket' in options:
-            options['urls'] = 'ldapi:/%s' % os.path.join(
-                options['location'], name+'.socket')
+            options['urls'] = 'ldapi://%s' % os.path.join(
+                options['location'], name+'.socket').replace(
+                '/', '%2F')
 
         # Initialize the conf options
         conf.init_options(



More information about the Checkins mailing list