Merge pull request #4070 from ipfs/feat/plugin/louder

plugin: make the info about non-executable file in plugins dir and Error log
This commit is contained in:
Jeromy Johnson 2017-07-16 02:36:11 -07:00 committed by GitHub
commit 88ad00360e
5 changed files with 14 additions and 4 deletions

View File

@ -1 +0,0 @@
preload.go

View File

@ -1,7 +1,7 @@
include mk/header.mk
$(d)/preload.go: d:=$(d)
$(d)/preload.go: $(d)/preload_list
$(d)/preload.go: $(d)/preload_list $(d)/preload.sh
$(d)/preload.sh > $@
go fmt $@ >/dev/null

View File

@ -32,7 +32,7 @@ func linuxLoadFunc(pluginDir string) ([]iplugin.Plugin, error) {
// file is not executable let's not load it
// this is to prevent loading plugins from for example non-executable
// mounts, some /tmp mounts are marked as such for security
log.Warningf("non-executable file in plugins directory: %s", fi)
log.Errorf("non-executable file in plugins directory: %s", fi)
return nil
}
@ -56,7 +56,6 @@ func loadPlugin(fi string) ([]iplugin.Plugin, error) {
if err != nil {
return nil, err
}
log.Errorf("plugins: %T", pls)
typePls, ok := pls.(*[]iplugin.Plugin)
if !ok {

7
plugin/loader/preload.go Normal file
View File

@ -0,0 +1,7 @@
package loader
import (
"github.com/ipfs/go-ipfs/plugin"
)
var preloadPlugins = []plugin.Plugin{}

View File

@ -20,6 +20,11 @@ done | sort -u
cat <<EOL
)
// DO NOT EDIT THIS FILE
// This file is being generated as part of plugin build process
// To change it, modify the plugin/loader/preload.sh
var preloadPlugins = []plugin.Plugin{
EOL