View Issue Details

IDProjectCategoryView StatusLast Update
0001803SOGoBackend Calendarpublic2014-05-23 18:13
Reporterr_bicelli Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3.14 
Summary0001803: Username part in Carddav URLS are case sensitive
Description

Assuming a domain authentication template like this:

<key>domains</key>
<dict>
<key>domain.adds</key>
<dict>
<key>SOGoMailDomain</key>
<string>domain.adds</string>
<key>SOGoUserSources</key>
<array>
<dict>
<key>CNFieldName</key>
<string>cn</string>
<key>IDFieldName</key>
<string>cn</string>
<key>IMAPLoginFieldName</key>
<string>userPrincipalName</string>
<key>UIDFieldName</key>
<string>sAMAccountName</string>
<key>baseDN</key>
<string>dc=domain,dc=adds</string>
<key>bindDN</key>
<string>adqueryuser@domain.adds</string>
<key>bindFields</key>
<array>
<string>userPrincipalName</string>
</array>
<key>bindPassword</key>
<string>XXXXXX</string>
<key>canAuthenticate</key>
<string>YES</string>
<key>displayName</key>
<string>DOMAIN</string>
<key>filter</key>
<string>objectclass=person</string>
<key>hostname</key>
<string>domain.adds</string>
<key>id</key>
<string>domain_adds</string>
<key>isAddressBook</key>
<string>YES</string>
<key>port</key>
<string>389</string>
<key>type</key>
<string>ldap</string>
</dict>
</array>
</dict>

I use, as IMAP username, the userPrincipalName Attribute which is
composed by USER ID + AD DOMAIN NAME.
As SOGo user ID I'm using the sAMAccountName attribute, just because
SOGo itself appends the domain part (I've set SOGoEnableDomainBasedUID
to YES)

Everything is working fine, except for using Thunderbird with SOGo
Integrator:

Assuming my username is TestDummy@domain.adds (contains lower and upper
case letters), when I try to sync contacts in TB console I see:

URLs don't match:
http://sogo/SOGo/dav/TestDummy@domain.adds/Contacts/personal vs .
http://sogo/SOGo/dav/testdummy@domain.adds/Contacts/personal

From Thunderbird, changing DAV URL property in the address book to
http://sogo/SOGo/dav/TestDummy@domain.adds/Contacts/personal solves the
problem.

Tables in mysql are named sogoTestDummy*, both for calendars and
contacts.

Additional Information

Running: SOGo 1.3.14-1.centos.x86_64

Thunderbird is 10.0.0.4 ESR
Integrator and connector plugins are 10.0.1

TagsNo tags attached.

Activities

ludovic

ludovic

2012-09-19 19:20

administrator   ~0004496

Can you try this patch?

============================================================
--- SoObjects/SOGo/SOGoObject.m 98b800daef478cd697254e89ba8053f3da848126
+++ SoObjects/SOGo/SOGoObject.m 990278bd26912578d9d746d3cbb2c8bdfdd78657
@@ -239,7 +239,7 @@
{
NSString *uid;

  • uid = [[context activeUser] login];

  • uid = [[[context activeUser] login] lowercaseString];
    activeUserIsOwner = [newOwner isEqualToString: uid];

    ASSIGN (owner, newOwner);

    --- SoObjects/SOGo/LDAPSource.m b7ee68561bd5075d49505725a889b3f472d236f6
    +++ SoObjects/SOGo/LDAPSource.m 6a01de4e8fa0f8e49d675501467e26be8c7ca1cd
    @@ -1021,7 +1021,7 @@ andMultipleBookingsField: (NSString *) n
    value = [[ldapEntry attributeWithName: IDField] stringValueAtIndex: 0];
    if (!value)
    value = @"";

  • [ldifRecord setObject: value forKey: @"c_name"];

  • [ldifRecord setObject: [value lowercaseString] forKey: @"c_name"];
    value = [[ldapEntry attributeWithName: UIDField] stringValueAtIndex: 0];
    if (!value)
    value = @"";
    @@ -1030,7 +1030,7 @@ andMultipleBookingsField: (NSString *) n
    // Eventually, we could check at this point if the entry is a group
    // and prefix the UID with a "@"
    // }

  • [ldifRecord setObject: value forKey: @"c_uid"];

  • [ldifRecord setObject: [value lowercaseString] forKey: @"c_uid"];
    value = [[ldapEntry attributeWithName: CNField] stringValueAtIndex: 0];
    if (!value)
    value = @"";

    --- SoObjects/SOGo/SOGoUserManager.m 344659dcdf8d929bb824d8856d05c1de85ce801e
    +++ SoObjects/SOGo/SOGoUserManager.m d956c73e690d51a15ad56e3af2030f2f02e32f51
    @@ -950,7 +950,7 @@
    && [theDN hasSuffix: [currentSource baseDN]])
    login = [currentSource lookupLoginByDN: theDN];

  • return login;

  • return [login lowercaseString];
    }

    @end

This is quite tricky because it'll break existing installations where people had "FooBar" defined as their username, because tablenames would have been created with the "sogoFooBar" prefix, and not "sogofoobar".

I guess we'll have to give some thoughts about this, and potentially offer a script that would "fix" the table names (ie., lowercase everything, and rename the tables).

ludovic

ludovic

2014-05-23 18:13

administrator   ~0007108

With the upcoming version of the SOGo Connector extension (v24.0.5), that problem should never happen again.

Issue History

Date Modified Username Field Change
2012-05-12 09:44 r_bicelli New Issue
2012-05-22 17:08 ludovic Target Version => 1.3.16
2012-06-06 14:24 ludovic Target Version 1.3.16 => 1.3.17
2012-07-16 12:45 ludovic Target Version 1.3.17 => 1.3.18
2012-08-27 15:57 francis Target Version 1.3.18 => 2.0.0
2012-09-19 17:19 ludovic Status new => assigned
2012-09-19 17:19 ludovic Assigned To => ludovic
2012-09-19 19:20 ludovic Note Added: 0004496
2012-09-19 19:21 ludovic Target Version 2.0.0 =>
2014-05-23 18:13 ludovic Note Added: 0007108
2014-05-23 18:13 ludovic Status assigned => resolved
2014-05-23 18:13 ludovic Resolution open => fixed