From 9674a302272806ec10cdccbc6072fc6f52c040d8 Mon Sep 17 00:00:00 2001 From: wrc Date: Sun, 13 Mar 2016 13:14:44 +0300 Subject: [PATCH] Fix -debug command line option misbehaviour: forbid stdin redirection to a pipe when run as plugin server --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f75736e65..3aa09846b 100644 --- a/main.go +++ b/main.go @@ -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 {