You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/05/17 11:32:04 UTC

[GitHub] [cloudstack-cloudmonkey] Pearl1594 commented on a change in pull request #80: Verify user access to config file

Pearl1594 commented on a change in pull request #80:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/80#discussion_r633451943



##########
File path: config/config.go
##########
@@ -85,7 +86,16 @@ func (c Config) CacheFile() string {
 	return path.Join(cacheDir, cacheFileName)
 }
 
+func hasAccess(path string) bool {
+    return unix.Access(path, unix.R_OK) == nil
+}
+
 func checkAndCreateDir(path string) string {
+	isAccsessible := hasAccess(path)

Review comment:
       Right! makes sense, it slipped my mind that we support other OSs too. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org