Github user dlmarion commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/111#discussion_r67013512
  
    --- Diff: 
core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java ---
    @@ -262,4 +267,46 @@ public boolean apply(final String input) {
     
       }
     
    +  public static class PortRange extends Matches {
    +
    +    private static final Logger log = 
LoggerFactory.getLogger(PortRange.class);
    +
    +    public PortRange(final String pattern) {
    +      super(pattern);
    +    }
    +
    +    @Override
    +    public boolean apply(final String input) {
    +      if (super.apply(input)) {
    +        try {
    +          PortRange.parse(input);
    +          return true;
    +        } catch (IllegalArgumentException e) {
    +          return false;
    +        }
    +      } else {
    +        return false;
    +      }
    +    }
    +
    +    public static Pair<Integer,Integer> parse(String portRange) {
    +      int idx = portRange.indexOf('-');
    +      if (idx != -1) {
    +        int low = Integer.parseInt(portRange.substring(0, idx));
    +        if (low < 1024) {
    --- End diff --
    
    Looks like I missed a range check:
    
              if (port < 1024 || port > 65535) {
                log.error("Invalid port number " + port + "; Using default " + 
property.getDefaultValue());
    
    I'll create a JIRA issue for it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to