• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5603: LdapContrib doesn't handle correctly mixed case usernames

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension LdapContrib Normal New MichaelDaum n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

When TWiki access control is handled by LDAPContrib and access to a web is allowed based on the LDAP directory group membership and when username has mixed case characters, for example sAMAccountName=Anut, then the access control fails and user is denied access to the web, even though the user is member of the appropriate LDAP group.

It seems that LdapContrib lowercases usernames and when its building the LDAP group cache, the lowercase version of the username is not found or is recorded incorrectly in the cache.

Workaround is to comment out one line in the LdapContrib.pm file, in the cacheUserFromEntry() function code:

  my $loginName = $entry->get_value($this->{loginAttribute});
  unless ($loginName) {
    $this->writeDebug("no loginName for $dn ... skipping");
    return 0;
  }
  
  #$loginName = lc($loginName);
  $loginName = from_utf8(-string=>$loginName, -charset=>$TWiki::cfg{Site}{CharSet})
    unless $TWiki::cfg{Site}{CharSet} =~ /^utf-?8$/i;

Possibly related to Item5381 and Item5603

-- TWiki:Main.AivoJurgenson - 06 May 2008

There are actually quite many such lowercase conversions. It seems that commenting them out will help with other cases as well.

# fgrep -n "lc(" LdapContrib.pm
393:  # $login = lc($login);
816:  #$loginName = lc($loginName);
1074:  #my $emails = TWiki::Sandbox::untaintUnchecked($this->{data}{"U2EMAILS::".lc($login)}) || '';
1108:  # $loginName = lc($loginName);
1168:  #$loginName = lc($loginName);

and

# fgrep -n "lc(" LdapUserMapping.pm
257:  # my $name = lc($thisName);

-- TWiki:Main.AivoJurgenson - 28 May 2008

ItemTemplate
Summary LdapContrib doesn't handle correctly mixed case usernames
ReportedBy TWiki:Main.AivoJurgenson
Codebase 4.2.1
SVN Range TWiki-5.0.0, Sun, 04 May 2008, build 16770
AppliesTo Extension
Component LdapContrib
Priority Normal
CurrentState New
WaitingFor MichaelDaum
Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-05-28 - AivoJurgenson
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback