You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Alexander Kolbasov (JIRA)" <ji...@apache.org> on 2016/10/18 23:24:58 UTC

[jira] [Resolved] (SENTRY-1506) Importing JDO or datanucleus properties from config is broken

     [ https://issues.apache.org/jira/browse/SENTRY-1506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Kolbasov resolved SENTRY-1506.
----------------------------------------
    Resolution: Not A Problem

Turns out this isn't a problem - the code does check for sentry .prefix.

> 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)