Commit 2093f7c1 by Adrián López Committed by GitHub

grafana-cli: Fix installing of plugins missing directory entries in zip (#26945)

parent 3403db19
...@@ -233,6 +233,12 @@ func extractFiles(archiveFile string, pluginName string, filePath string, allowS ...@@ -233,6 +233,12 @@ func extractFiles(archiveFile string, pluginName string, filePath string, allowS
return fmt.Errorf(permissionsDeniedMessage, newFile) return fmt.Errorf(permissionsDeniedMessage, newFile)
} }
} else { } else {
// Create needed directories to extract file
err := os.MkdirAll(filepath.Dir(newFile), 0755)
if err != nil {
return errutil.Wrap("failed to create directory to extract plugin files", err)
}
if isSymlink(zf) { if isSymlink(zf) {
if !allowSymlinks { if !allowSymlinks {
logger.Errorf("%v: plugin archive contains symlink which is not allowed. Skipping \n", zf.Name) logger.Errorf("%v: plugin archive contains symlink which is not allowed. Skipping \n", zf.Name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment