Issue 8284 - back-relay: olcRelay issues with values containing white spaces
Summary: back-relay: olcRelay issues with values containing white spaces
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.42
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-21 13:10 UTC by michele.bensi@fisica.unimi.it
Modified: 2015-11-30 18:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description michele.bensi@fisica.unimi.it 2015-10-21 13:10:36 UTC
Full_Name: Michele Bensi
Version: 2.4.42
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (159.149.47.246)


When configuring realy backend using a relay suffix containg spaces I got this
error:

ldap_add: Constraint violation (19)
        additional info: <olcRelay> extra cruft after <relay>

A%A
To reproduce the problem just configure back_relay with a value containing white
spaces
(i.e. olcRelay: ou=Dipartimento di Fisica,o=Universit� degli Studi di
Milano,c=IT)
Comment 1 Howard Chu 2015-10-21 14:12:14 UTC
michele.bensi@fisica.unimi.it wrote:
> Full_Name: Michele Bensi
> Version: 2.4.42
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (159.149.47.246)
>
>
> When configuring realy backend using a relay suffix containg spaces I got this
> error:
>
> ldap_add: Constraint violation (19)
>          additional info: <olcRelay> extra cruft after <relay>
> A%A
> To reproduce the problem just configure back_relay with a value containing white
> spaces
> (i.e. olcRelay: ou=Dipartimento di Fisica,o=Università degli Studi di
> Milano,c=IT)

Use double-quotes around arguments containing whitespace.

Closing this ITS.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 michele.bensi@fisica.unimi.it 2015-10-21 14:19:49 UTC
Well this was the first thing I tried, but when I use

olcRelay: "ou=Dipartimento di Fisica,o=Università degli Studi di Milano,c=IT"

I got

ldap_add: Invalid syntax (21)
        additional info: olcRelay: value #0 invalid per syntax

Then I tried with

olcRelay: ou="Dipartimento di Fisica",o="Università degli Studi di Milano",c=IT

I had the same error of extra cruft.

I solved patching servers/slapd/back-relay/init.c this way

--- a/servers/slapd/back-relay/init.c   2015-10-20 15:22:20.511667130 +0200
+++ b/servers/slapd/back-relay/init.c   2015-10-21 10:27:02.649251347 +0200
@@ -32,7 +32,7 @@
 
 static ConfigTable relaycfg[] = {
        { "relay", "relay", 2, 2, 0,
-               ARG_MAGIC|ARG_DN,
+               ARG_MAGIC|ARG_DN|ARG_QUOTE,
                relay_back_cf, "( OLcfgDbAt:5.1 "
                        "NAME 'olcRelay' "
                        "DESC 'Relay DN' "



On Wed, Oct 21, 2015 at 03:12:14PM +0100, Howard Chu wrote:
> michele.bensi@fisica.unimi.it wrote:
> >Full_Name: Michele Bensi
> >Version: 2.4.42
> >OS: Linux
> >URL: ftp://ftp.openldap.org/incoming/
> >Submission from: (NULL) (159.149.47.246)
> >
> >
> >When configuring realy backend using a relay suffix containg spaces I got this
> >error:
> >
> >ldap_add: Constraint violation (19)
> >         additional info: <olcRelay> extra cruft after <relay>
> >A%A
> >To reproduce the problem just configure back_relay with a value containing white
> >spaces
> >(i.e. olcRelay: ou=Dipartimento di Fisica,o=Università degli Studi di
> >Milano,c=IT)
> 
> Use double-quotes around arguments containing whitespace.
> 
> Closing this ITS.
> 
> -- 
>   -- Howard Chu
>   CTO, Symas Corp.           http://www.symas.com
>   Director, Highland Sun     http://highlandsun.com/hyc/
>   Chief Architect, OpenLDAP  http://www.openldap.org/project/

-- 
Michele Bensi

Unità Calcolo
Dipartimento di Fisica
Università degli Studi di Milano
Via Celoria, 16
20133 Milano (MI)
ITALY

Phone: +39 02503 17341
Fax:   +39 02503 17280
Room:  I/T/4

"Unix is user-friendly. It's just very selective about who its friends are."

Comment 3 Michael Ströder 2015-10-21 14:38:27 UTC
hyc@symas.com wrote:
>> To reproduce the problem just configure back_relay with a value containing white
>> spaces
>> (i.e. olcRelay: ou=Dipartimento di Fisica,o=Universitŕ degli Studi di
>> Milano,c=IT)
> 
> Use double-quotes around arguments containing whitespace.

Attribute 'olcRelay' is of LDAP syntax Distinguished Name
(1.3.6.1.4.1.1466.115.121.1.12). So your statement is pretty surprising.

> Closing this ITS.

Really?

Ciao, Michael.


Comment 4 Howard Chu 2015-10-25 08:19:52 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 5 Quanah Gibson-Mount 2015-10-26 21:11:36 UTC
changed notes
changed state Test to Release
Comment 6 OpenLDAP project 2015-11-30 18:21:46 UTC
fixed in master
fixed in RE25
fixed in RE24 (2.4.43)
Comment 7 Quanah Gibson-Mount 2015-11-30 18:21:46 UTC
changed notes
changed state Release to Closed