Alexander Kolbasov created SENTRY-1506:
------------------------------------------

             Summary: Importing JDO or datanucleus properties from config is 
broken
                 Key: SENTRY-1506
                 URL: https://issues.apache.org/jira/browse/SENTRY-1506
             Project: Sentry
          Issue Type: Bug
          Components: Sentry
    Affects Versions: 1.7.0, sentry-ha-redesign
            Reporter: Alexander Kolbasov
            Assignee: Alexander Kolbasov


SentryStore.java has a piece of code that takes JDO or datanucleus properties 
from config file:

{code}
    public static final String SENTRY_DB_PROPERTY_PREFIX = "sentry.";
    public static final String SENTRY_JAVAX_JDO_PROPERTY_PREFIX = 
SENTRY_DB_PROPERTY_PREFIX + "javax.jdo";
    public static final String SENTRY_DATANUCLEUS_PROPERTY_PREFIX = 
SENTRY_DB_PROPERTY_PREFIX + "datanucleus";
{code}
{code}
    for (Map.Entry<String, String> entry : conf) {
      String key = entry.getKey();
      if (key.startsWith(ServerConfig.SENTRY_JAVAX_JDO_PROPERTY_PREFIX) ||
          key.startsWith(ServerConfig.SENTRY_DATANUCLEUS_PROPERTY_PREFIX)) {
        key = StringUtils.removeStart(key, 
ServerConfig.SENTRY_DB_PROPERTY_PREFIX);
        prop.setProperty(key, entry.getValue());
      }
    }
{code}

The intention apparently was to read properties starting from "sentry." but the 
code picks up properties which don't start with ".sentry".

So the code doesn't make much sense, but an important question is whether 
anyone depends on the existing behavior.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to