]> git.sur5r.net Git - openldap/commitdiff
quotes needed for spaces in DN (ITS#7525)
authorPierangelo Masarati <ando@OpenLDAP.org>
Tue, 12 Feb 2013 16:17:42 +0000 (17:17 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 21 Feb 2013 18:20:13 +0000 (10:20 -0800)
servers/slapd/back-meta/config.c

index 1e46ff5a461a16c8b8f089e87704f25500875338..f3a6d017f289a114559b2bd229eb3a7019234dc4 100644 (file)
@@ -1352,15 +1352,18 @@ meta_back_cf_gen( ConfigArgs *c )
                /* target attrs */
                case LDAP_BACK_CFG_URI: {
                        char *p2, *p1 = strchr( mt->mt_uri, ' ' );
-                       bv.bv_len = strlen( mt->mt_uri ) + 1 + mt->mt_psuffix.bv_len;
+                       bv.bv_len = strlen( mt->mt_uri ) + 3 + mt->mt_psuffix.bv_len;
                        bv.bv_val = ch_malloc( bv.bv_len + 1 );
+                       p2 = bv.bv_val;
+                       *p2++ = '"';
                        if ( p1 ) {
-                               p2 = lutil_strncopy( bv.bv_val, mt->mt_uri, p1 - mt->mt_uri );
+                               p2 = lutil_strncopy( p2, mt->mt_uri, p1 - mt->mt_uri );
                        } else {
-                               p2 = lutil_strcopy( bv.bv_val, mt->mt_uri );
+                               p2 = lutil_strcopy( p2, mt->mt_uri );
                        }
                        *p2++ = '/';
                        p2 = lutil_strcopy( p2, mt->mt_psuffix.bv_val );
+                       *p2++ = '"';
                        if ( p1 ) {
                                strcpy( p2, p1 );
                        }