Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 420644 - [Security] Multiple repositories in a server share a SecurityManager
Summary: [Security] Multiple repositories in a server share a SecurityManager
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.3   Edit
Hardware: PC Mac OS X
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 418454
  Show dependency tree
 
Reported: 2013-10-29 11:43 EDT by Christian Damus CLA
Modified: 2020-12-11 10:33 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2013-10-29 11:43:38 EDT
Git master as of commit bd2c813 at least.

The SecurityExtension is intended to set up a SecurityManager for each repository that has a <securityManager> element in its configuration XML.  However, when the descriptions of the security managers in different repositories look similar, the result is that the IPluginContainer.INSTANCE creates only a single SecurityManager and the SecurityExtension attempts to assign it to all of the repositories.

This causes problems because a SecurityManager is designed to be paired with a single repository.  The setRepository(...) method does:

  * assign the reference to the repository
  * if the realm was not previously initialized,
    connect a JVM transport session to the repository
    and initialize the realm

Let's say I have two repositories in my server that all create a security manager in the default configuration:

   <securityManager
      type="default"
      description="/security:annotation:home(/home)"/>

The SecurityExtension triggers creation of this SecurityManager in the shared container  when processing the first repository and sets the repository into the security manager, which proceeds to connect to it and initialize the realm.

On the second repository, the SecurityExtension retrieves the *same* SecurityManager instance from the container and sets another repository into it.  The SecurityManager updates its repository reference but finds it already has a realm from the other repository, so does nothing further.  Now the SecurityManager has a realm from one repository and things it is providing security for another.

This doesn't work.  We need to ensure that the container has a distinct SecurityManager for every repository that needs one.  I suggest qualifying the security manager's description in the container with the name of the repository.
Comment 1 Christian Damus CLA 2013-10-29 12:09:34 EDT
I have pushed a proposed fix to Gerrit:

https://git.eclipse.org/r/17847
Comment 2 Christian Damus CLA 2013-11-04 12:16:29 EST
Fixed in git master.

commit 1b0d6481333b6d52a560d595b793e2c687f25fa0
Comment 3 Eike Stepper CLA 2020-12-11 10:28:20 EST
Closing.
Comment 4 Eike Stepper CLA 2020-12-11 10:33:27 EST
Closing.