Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41BCB104E2 for ; Wed, 18 Sep 2013 04:48:25 +0000 (UTC) Received: (qmail 39060 invoked by uid 500); 18 Sep 2013 04:48:03 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 38966 invoked by uid 500); 18 Sep 2013 04:47:56 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 38939 invoked by uid 99); 18 Sep 2013 04:47:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Sep 2013 04:47:53 +0000 Date: Wed, 18 Sep 2013 04:47:52 +0000 (UTC) From: "Freeman Fang (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (KARAF-2476) Special characters are dropped when generating the LDAP the user and role filters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Freeman Fang resolved KARAF-2476. --------------------------------- Resolution: Fixed Fix Version/s: 2.3.4 3.0.0 2.4.0 > Special characters are dropped when generating the LDAP the user and role filters > --------------------------------------------------------------------------------- > > Key: KARAF-2476 > URL: https://issues.apache.org/jira/browse/KARAF-2476 > Project: Karaf > Issue Type: Bug > Reporter: Jonathan Anstey > Assignee: Freeman Fang > Fix For: 2.4.0, 3.0.0, 2.3.4 > > Attachments: KARAF-2476-karaf-2.x.patch > > > The current code - org.apache.karaf.jaas.modules.ldap.LDAPLoginModule - forms the userFilter and roleFilter: > logger.debug("Looking for the user in LDAP with "); > logger.debug(" base DN: " + userBaseDN); > userFilter = userFilter.replaceAll("%u", user); > logger.debug("Looking for the user roles in LDAP with "); > logger.debug(" base DN: " + roleBaseDN); > roleFilter = roleFilter.replaceAll("%u", user); > roleFilter = roleFilter.replaceAll("%dn", userDN); > the "replaceAll" method is a regular expression replacement that interprets special characters. LDAP user names and DN can contain special characters and we do not want to process them. The filters should be formed as "quotes" - uninterpreted strings. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira