mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

dugan
01.40.2007 eacb35f99135e247d083de79a0e4d32dfc5ff42b
Fix using operational attributes in userattr bind rule keyword. Issue 1760.
2 files modified
21 ■■■■ changed files
opends/src/server/org/opends/server/authorization/dseecompat/ParentInheritance.java 15 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/authorization/dseecompat/UserAttr.java 6 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/authorization/dseecompat/ParentInheritance.java
@@ -69,6 +69,12 @@
     */
    private AttributeType attributeType;
    /*
     * The attribute type string parsed from the rule. Only used in
     * inheritance search.
     */
    private String attrTypeStr;
    /**
     * Construct a class from the inheritance pattern. The skipParsing boolean
@@ -150,6 +156,7 @@
                DirectoryServer.getAttributeType(toks[1])) == null)
                this.attributeType =
                    DirectoryServer.getDefaultAttributeType(toks[1]);
            attrTypeStr=toks[1];
            StringTokenizer tok=new StringTokenizer(toks[0],"],",false);
            while(tok.hasMoreTokens()) {
                String v=tok.nextToken();
@@ -206,5 +213,13 @@
    public AttributeType getAttributeType() {
        return attributeType;
    }
    /**
     * Return the string representation of the attribute type.
     * @return   The attribute type string.
     */
    public String getAttrTypeStr() {
        return attrTypeStr;
    }
}
opends/src/server/org/opends/server/authorization/dseecompat/UserAttr.java
@@ -342,21 +342,21 @@
                        getDNParentLevel(levels[i], evalCtx.getResourceDN());
                if(pDN == null)
                    continue;
                LinkedHashSet<String> reqAttrs = new LinkedHashSet<String>(1);
                reqAttrs.add(parentInheritance.getAttrTypeStr());
                InternalClientConnection conn =
                        InternalClientConnection.getRootConnection();
                InternalSearchOperation op = conn.processSearch(pDN,
                        SearchScope.BASE_OBJECT,
                        DereferencePolicy.NEVER_DEREF_ALIASES, 0, 0, false,
                        filter, null);
                        filter, reqAttrs);
                LinkedList<SearchResultEntry> result =
                        op.getSearchEntries();
                if (!result.isEmpty()) {
                    Entry e = result.getFirst();
                    if (e.hasAttribute(attrType)) {
                        matched = evalEntryAttr(e, evalCtx, attrType);
                        if(matched.equals(EnumEvalResult.TRUE))
                            stop=true;
                    }
                }
            }
        }