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

lutoff
02.47.2008 270966d535649a20111b5cfa967fa94244bb6456
Fix for issue #3041 (ldapsearch: trailing arguments are not interpreted as attributes when --filename option is specify)

Trailing arguments should be structured as follow:
- If a filter file is present, trailing arguments are considered
as attributes
- If filter file is not present, the first trailing argument is
considered the filter, the other as attributes.
1 files modified
9 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java
@@ -1079,7 +1079,15 @@
      argParser.getTrailingArguments();
    if(filterAndAttributeStrings.size() > 0)
    {
      // the list of trailing arguments should be structured as follow:
      // - If a filter file is present, trailing arguments are considered
      //   as attributes
      // - If filter file is not present, the first trailing argument is
      // considered the filter, the other as attributes.
      if (! filename.isPresent())
      {
      String filterString = filterAndAttributeStrings.remove(0);
      try
      {
        filters.add(LDAPFilter.decode(filterString));
@@ -1092,6 +1100,7 @@
        err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
        return 1;
      }
      }
      // The rest are attributes
      for(String s : filterAndAttributeStrings)
      {