Skip to content

Commit 7a91f20

Browse files
committed
Merge pull request #401 from cyberious/FM-2131
FM-2131 Move to non temp directory for factor_dot_d
2 parents 80f0962 + 9e380b9 commit 7a91f20

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
##2015-01-14 - Supported Release 4.5.1
2+
###Summary
3+
4+
This release changes the temporary facter_dot_d cache locations outside of the /tmp directory due to a possible security vunerability. CVE-2015-1029
5+
6+
####Bugfixes
7+
- Facter_dot_d cache will now be stored in puppet libdir instead of tmp
8+
19
##2014-12-15 - Supported Release 4.5.0
210
###Summary
311

lib/facter/facter_dot_d.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
class Facter::Util::DotD
1616
require 'yaml'
1717

18-
def initialize(dir="/etc/facts.d", cache_file="/tmp/facts_cache.yml")
18+
def initialize(dir="/etc/facts.d", cache_file=File.join(Puppet[:libdir], "facts_dot_d.cache"))
1919
@dir = dir
2020
@cache_file = cache_file
2121
@cache = nil
2222
@types = {".txt" => :txt, ".json" => :json, ".yaml" => :yaml}
2323
end
2424

2525
def entries
26-
Dir.entries(@dir).reject{|f| f =~ /^\.|\.ttl$/}.sort.map {|f| File.join(@dir, f) }
26+
Dir.entries(@dir).reject { |f| f =~ /^\.|\.ttl$/ }.sort.map { |f| File.join(@dir, f) }
2727
rescue
2828
[]
2929
end
@@ -113,7 +113,7 @@ def script_parser(file)
113113

114114
def cache_save!
115115
cache = load_cache
116-
File.open(@cache_file, "w", 0600) {|f| f.write(YAML.dump(cache)) }
116+
File.open(@cache_file, "w", 0600) { |f| f.write(YAML.dump(cache)) }
117117
rescue
118118
end
119119

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-stdlib",
3-
"version": "4.5.0",
3+
"version": "4.5.1",
44
"author": "puppetlabs",
55
"summary": "Standard library of resources for Puppet modules.",
66
"license": "Apache-2.0",

0 commit comments

Comments
 (0)