LDAP support for non-standard port LDAP Urls

Bug #1215190 reported by Aaron Wells on 2013-08-21
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Medium
Unassigned
1.5
Medium
Unassigned
1.6
Medium
Unassigned
1.7
Medium
Unassigned
1.8
Medium
John Kelsh

Bug Description

This came up from a user asking for help on IRC. They had upgraded their site from Mahara 1.4 to Mahara 1.5 and found that LDAP authentication stopped working. Their LDAP "host URL" field was in this format: ldap://fake-dc1.fake.ac.uk:3268;

In Mahara 1.4, this string would be passed in as the first and only parameter to ldap_connect().

In Mahara 1.5, the code is "smarter" and notices the final colon before the port number 3268. It strips this off of the URL, and passes "ldap://fake-dc1.fake.ac.uk" as the first parameter and "3268" as the second parameter to ldap_connect().

The problem is, if the first parameter to ldap-connect is in "URL style" starting with a protocol ldap:// or ldaps://, ldap_connect() IGNORES the second parameter. And so the port was stripped off, and then ignored, and the connection didn't work.

Making matters worse, the documentation tells people to put a protocol header on the front of their "Host URL".

John Kelsh (jkelsh) wrote :

Possible solution attached.

Aaron Wells (u-aaronw) wrote :

Hi John,

Thanks for the patch! I've pushed it into our code review system here: https://reviews.mahara.org/2492

Cheers,
Aaron

Changed in mahara:
status: Triaged → In Progress
status: In Progress → Triaged
status: Triaged → Confirmed

Reviewed: https://reviews.mahara.org/2492
Committed: http://gitorious.org/mahara/mahara/commit/e664af6858765d8beda9b085d50b50f8f5d0787b
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit e664af6858765d8beda9b085d50b50f8f5d0787b
Author: John Kelsh <email address hidden>
Date: Thu Sep 12 19:40:03 2013 +1200

LDAP support for LDAP URLs with non-standard ports

Bug 1215190

Change-Id: I9cc40f1a528bd92398b16df833fcaf8aaf314ff7
Signed-off-by: Aaron Wells <email address hidden>

tags: added: nominatedfeature
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2507
Committed: http://gitorious.org/mahara/mahara/commit/352246f795f7acfc4a5c660513835010d2a3fedc
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.6_STABLE

commit 352246f795f7acfc4a5c660513835010d2a3fedc
Author: John Kelsh <email address hidden>
Date: Thu Sep 12 19:40:03 2013 +1200

LDAP support for LDAP URLs with non-standard ports

Bug 1215190

Change-Id: I9cc40f1a528bd92398b16df833fcaf8aaf314ff7
Signed-off-by: Aaron Wells <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2508
Committed: http://gitorious.org/mahara/mahara/commit/0347ee5dd338e0d420238acfd7d74422fa6821f2
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.7_STABLE

commit 0347ee5dd338e0d420238acfd7d74422fa6821f2
Author: John Kelsh <email address hidden>
Date: Thu Sep 12 19:40:03 2013 +1200

LDAP support for LDAP URLs with non-standard ports

Bug 1215190

Change-Id: I9cc40f1a528bd92398b16df833fcaf8aaf314ff7
Signed-off-by: Aaron Wells <email address hidden>

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2509
Committed: http://gitorious.org/mahara/mahara/commit/c377ebeeb02bdf44668a86979344a634783187a0
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.5_STABLE

commit c377ebeeb02bdf44668a86979344a634783187a0
Author: John Kelsh <email address hidden>
Date: Thu Sep 12 19:40:03 2013 +1200

LDAP support for LDAP URLs with non-standard ports

Bug 1215190

Change-Id: I9cc40f1a528bd92398b16df833fcaf8aaf314ff7
Signed-off-by: Aaron Wells <email address hidden>

Aaron Wells (u-aaronw) on 2013-09-19
Changed in mahara:
status: Confirmed → Fix Committed
Aaron Wells (u-aaronw) on 2013-09-30
Changed in mahara:
milestone: 1.5.12 → 1.8.0
Aaron Wells (u-aaronw) on 2013-10-24
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers