From 3ecd3761cdffacfd42f01e36571bc5036f504af1 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Sun, 10 Mar 2013 11:54:58 -0700 Subject: [PATCH] (#19391) Find the catalog for the specified node name Previously, the test was invoking the Catalog.indirection.find method but passing in a Node instance. This used to "work" in 2.7.x, because the compiler terminus only looked at `request.key`, in this case the node name, and ignored the `request.instance`. The test appears to verify that we can compile a node with the specified facts. But the test doesn't verify that the facts are in the returned catalog (they're not). So in reality, this test is passing when it shouldn't. To pass a Node instance through to the compiler, you need to use the `use_node` option, e.g. :use_node => node.to_yaml. To pass facts, use the use the `facts` option, e.g. :facts => facts.to_yaml. Since the test passes in a Node instance, the node is cached instead of the compiled catalog, which is one of the issues described in CVE-2013-1652. This commit changes the test to pass in the node.name, and it ensures we can compile a catalog for it. --- test/language/snippets.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/language/snippets.rb b/test/language/snippets.rb index d7d50701e..c00e15a50 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -494,7 +494,7 @@ class TestSnippets < Test::Unit::TestCase catalog = nil assert_nothing_raised("Could not compile catalog") { - catalog = Puppet::Resource::Catalog.indirection.find(node) + catalog = Puppet::Resource::Catalog.indirection.find(node.name) } assert_nothing_raised("Could not convert catalog") {