[Dovecot] [PATCH] Substitution of dots to ", dc=" in variable expansions
Hi list,
my ldap directory uses DNs like this:
uid=solist,ou=People,dc=solistland,dc=net,ou=Virtuals
but I only could use something like
uid=solist,ou=People,dc=solistland.net,ou=Virtuals
with dovecot, which obviously isn't what the dcObject object class was meant to present.
I've written a small function for var-expand.c which introduces a new modifier for string variable expansions, %D (arbitrarily chosen), which substitutes dots to ",dc=". You might want to include that in dovecot's code base, after bringing it up to dovecot standards of course. :-)
Example of use:
base = ou=People,dc=%Dd,ou=Virtuals
Warning: I'm a beginner in C and could only understand so much of dovecot's code, so this patch is a hack at best. That said, I tested it with more than 10k logins and can say it works for me. :-D
Cheers, Antonio
On 205, 07 24, 2006 at 03:41:00PM +0300, Antonio Kanouras wrote:
Hi list,
my ldap directory uses DNs like this:
uid=solist,ou=People,dc=solistland,dc=net,ou=Virtuals
but I only could use something like
uid=solist,ou=People,dc=solistland.net,ou=Virtuals
with dovecot, which obviously isn't what the dcObject object class was meant to present.
I've written a small function for var-expand.c which introduces a new modifier for string variable expansions, %D (arbitrarily chosen), which substitutes dots to ",dc=". You might want to include that in dovecot's code base, after bringing it up to dovecot standards of course. :-)
Example of use:
base = ou=People,dc=%Dd,ou=Virtuals
Warning: I'm a beginner in C and could only understand so much of dovecot's code, so this patch is a hack at best. That said, I tested it with more than 10k logins and can say it works for me. :-D
You do not need all this RET_SIZE nightmare, dovecot string API will resize string when necessary. Can you test an attached simplified patch ?
-- Andrey Panin | Linux and UNIX system administrator pazke@donpac.ru | PGP key: wwwkeys.pgp.net
Andrey Panin wrote:
You do not need all this RET_SIZE nightmare, dovecot string API will resize string when necessary. Can you test an attached simplified patch ?
Worked like a charm!
Many thanks for the enlightenment and your prompt response!
Any chance of it being included in dovecot? :-)
Cheers, Antonio
participants (2)
-
Andrey Panin
-
Antonio Kanouras