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:29:11 UTC

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

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



##########
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:
       @Pearl1594 could the fix to be simply to try and open the file and handle the failure? It's because people may use cmk on Mac and Windows.




-- 
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