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

    https://github.com/apache/incubator-brooklyn/pull/115#discussion_r16181267
  
    --- Diff: 
usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java ---
    @@ -485,6 +498,37 @@ public BrooklynLauncher start() {
             return this;
         }
     
    +    private void checkFileReadable(String file) {
    +        File f = new File(Os.tidyPath(file));
    +        if (!f.exists()) {
    +            throw new FatalRuntimeException("File "+file+" does not 
exist");
    +        }
    +        if (!f.isFile()) {
    +            throw new FatalRuntimeException(file+" is not a file");
    +        }
    +        if (!f.canRead()) {
    +            throw new FatalRuntimeException(file+" is not readable");
    +        }
    +    }
    +    
    +    private void checkFilePermissionsX00(String file) {
    +        File f = new File(Os.tidyPath(file));
    +        if (f.exists() && f.isFile() && f.canRead()) {
    +            try {
    +                Maybe<String> permission = FileUtil.getFilePermissions(f);
    +                if (permission.isAbsent()) {
    +                    LOG.debug("Could not determine permissions of global 
brooklyn properties file; assuming ok: "+f);
    +                } else {
    +                    if (!permission.get().substring(4).equals("------")) {
    +                        throw new FatalRuntimeException("Invalid 
permissions for file "+file+"; expected 600 but was "+permission.get());
    --- End diff --
    
    Odd mix of numeric and flag formats; maybe combine both: `rwxr--r-- (744)`
    
    Also, not strictly correct to say "expected 600".


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to