From 3b5145bf51c0a887233b7d97208b9329aefc2d64 Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Tue, 24 Feb 2015 21:43:36 +0100 Subject: [PATCH] apt::params: Make the class private. Prevent direct access to apt::params. This will ensure that any other module cannot blindly access apt::params and get settings that have been potentially overridden at the apt level. Our own module still can since any class in apt has a module_name of 'apt' but that's up to us to prevent from happening. Every setting must now be accessed by a qualified lookup into the apt namespace. --- manifests/params.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index 765677f..8f9d7e8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,4 +1,9 @@ class apt::params { + + if $caller_module_name and $caller_module_name != $module_name { + fail('apt::params is a private class and cannot be accessed directly') + } + $root = '/etc/apt' $provider = '/usr/bin/apt-get' $sources_list = "${root}/sources.list" -- 2.45.2