Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-49545

LDAP Filter with double parenthesis can cause problems

    Details

      Description

      When user filter is specified like:

      (&(objectClass=person)(!(uid=test))) the following query is constructed:
      (&(uid=user1){color:red}*(*{color}(&(objectClass=person)(!(uid=test))))
      

      altough the following query should be generated:

      (&(uid=user1)(&(objectClass=person)(!(uid=test))))
      

      The originally generated query can returns no value on ApacheDS and the UI shows the query to invalid.

      The same double parenthesis issue exists with groupFilter as well.

      The problem with these that it could lead to NullPointerExceptions during User import:

      [PortalLDAPImporterImpl:701] Unable to import user uid=xxxx,ou=users,ou=intranet: null:null:{
      uid=uid: xxxx}
      
      java.lang.NullPointerException
      	at com.liferay.portal.security.ldap.PortalLDAPUtil.getNameInNamespace(PortalLDAPUtil.java:393)
      	at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importGroups(PortalLDAPImporterImpl.java:795)
      	at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAPByUser(PortalLDAPImporterImpl.java:696)
      	at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:198)
      	at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:149)
      	at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:43)
      	at com.liferay.portal.util.PortalInstances._initCompany(PortalInstances.java:484)
      	at com.liferay.portal.util.PortalInstances.initCompany(PortalInstances.java:95)
      	at com.liferay.portal.servlet.MainServlet.initCompanies(MainServlet.java:784)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:353)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:241)
      	at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)
      	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:169)
      	at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1809)
      	at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)
      	at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:1011)
      	at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:932)
      	at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:611)
      	at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:429)
      	at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:304)
      	at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100)
      	at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:166)
      	at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:731)
      	at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:616)
      	at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)
      	at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)
      	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1122)
      	at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1319)
      	at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:609)
      	at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
      	at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:725)
      	at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2046)
      	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:439)
      	at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
      	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:382)
      	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:110)
      	at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:949)
      	at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
      	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1563)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ian.song Ian Song (Inactive)
              Reporter:
              vilmos.papp Vilmos Papp
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 45 weeks, 6 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.X EE
                  7.0.0 Beta 7