Browse code

Forbid attach to ghost

Guillaume J. Charmes authored on 2013/04/20 06:18:03
Showing 1 changed files
... ...
@@ -836,6 +836,10 @@ func (srv *Server) CmdAttach(stdin io.ReadCloser, stdout rcli.DockerConn, args .
836 836
 		return fmt.Errorf("No such container: %s", name)
837 837
 	}
838 838
 
839
+	if container.State.Ghost {
840
+		return fmt.Errorf("Impossible to attach to a ghost container")
841
+	}
842
+
839 843
 	if container.Config.Tty {
840 844
 		stdout.SetOptionRawTerminal()
841 845
 	}