Merge pull request #3346 from theang/master

Fix -debug command line option misbehaviour: forbid stdin redirection…
This commit is contained in:
Chris Bednarski 2016-03-15 16:04:52 -07:00
commit ba5166da8c
1 changed files with 4 additions and 1 deletions

View File

@ -112,7 +112,10 @@ func wrappedMain() int {
log.Printf("Built with Go Version: %s", runtime.Version())
// Prepare stdin for plugin usage by switching it to a pipe
setupStdin()
// But do not switch to pipe in plugin
if os.Getenv(plugin.MagicCookieKey) != plugin.MagicCookieValue {
setupStdin()
}
config, err := loadConfig()
if err != nil {