puppet 6.23.0-universal-darwin → 6.24.0-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +5 -5
- data/Gemfile.lock +8 -8
- data/README.md +4 -4
- data/ext/project_data.yaml +1 -0
- data/lib/puppet/application/filebucket.rb +1 -0
- data/lib/puppet/application/resource.rb +15 -2
- data/lib/puppet/application/ssl.rb +1 -0
- data/lib/puppet/environments.rb +10 -0
- data/lib/puppet/face/help/action.erb +1 -0
- data/lib/puppet/face/help/face.erb +1 -0
- data/lib/puppet/face/node/clean.rb +11 -0
- data/lib/puppet/file_system/file_impl.rb +1 -1
- data/lib/puppet/file_system/windows.rb +2 -2
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions/empty.rb +8 -0
- data/lib/puppet/functions/strftime.rb +1 -0
- data/lib/puppet/functions/unwrap.rb +17 -2
- data/lib/puppet/indirector/resource/ral.rb +6 -1
- data/lib/puppet/interface/documentation.rb +1 -0
- data/lib/puppet/module_tool/applications/installer.rb +4 -0
- data/lib/puppet/module_tool/errors/shared.rb +17 -0
- data/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
- data/lib/puppet/provider/exec/posix.rb +16 -4
- data/lib/puppet/provider/package/pip.rb +15 -3
- data/lib/puppet/provider/parsedfile.rb +3 -0
- data/lib/puppet/settings.rb +30 -7
- data/lib/puppet/type/exec.rb +16 -3
- data/lib/puppet/type/file/mode.rb +6 -0
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/util/symbolic_file_mode.rb +29 -17
- data/lib/puppet/util/windows/sid.rb +3 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet.rb +3 -3
- data/locales/puppet.pot +154 -134
- data/man/man5/puppet.conf.5 +2 -2
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +9 -9
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +8 -8
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +7 -7
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +5 -5
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +5 -5
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-ssl.8 +1 -1
- data/man/man8/puppet-status.8 +4 -4
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/ssl/127.0.0.1-key.pem +106 -106
- data/spec/fixtures/ssl/127.0.0.1.pem +48 -48
- data/spec/fixtures/ssl/bad-basic-constraints.pem +54 -54
- data/spec/fixtures/ssl/bad-int-basic-constraints.pem +51 -51
- data/spec/fixtures/ssl/ca.pem +52 -52
- data/spec/fixtures/ssl/crl.pem +25 -25
- data/spec/fixtures/ssl/ec-key.pem +11 -11
- data/spec/fixtures/ssl/ec.pem +32 -32
- data/spec/fixtures/ssl/encrypted-ec-key.pem +12 -12
- data/spec/fixtures/ssl/encrypted-key.pem +107 -107
- data/spec/fixtures/ssl/intermediate-agent-crl.pem +25 -25
- data/spec/fixtures/ssl/intermediate-agent.pem +54 -54
- data/spec/fixtures/ssl/intermediate-crl.pem +28 -28
- data/spec/fixtures/ssl/intermediate.pem +51 -51
- data/spec/fixtures/ssl/oid-key.pem +117 -0
- data/spec/fixtures/ssl/oid.pem +69 -0
- data/spec/fixtures/ssl/pluto-key.pem +106 -106
- data/spec/fixtures/ssl/pluto.pem +50 -50
- data/spec/fixtures/ssl/request-key.pem +106 -106
- data/spec/fixtures/ssl/request.pem +45 -45
- data/spec/fixtures/ssl/revoked-key.pem +106 -106
- data/spec/fixtures/ssl/revoked.pem +49 -49
- data/spec/fixtures/ssl/signed-key.pem +106 -106
- data/spec/fixtures/ssl/signed.pem +47 -47
- data/spec/fixtures/ssl/tampered-cert.pem +49 -49
- data/spec/fixtures/ssl/tampered-csr.pem +45 -45
- data/spec/fixtures/ssl/trusted_oid_mapping.yaml +5 -0
- data/spec/fixtures/ssl/unknown-127.0.0.1-key.pem +106 -106
- data/spec/fixtures/ssl/unknown-127.0.0.1.pem +48 -48
- data/spec/fixtures/ssl/unknown-ca-key.pem +106 -106
- data/spec/fixtures/ssl/unknown-ca.pem +52 -52
- data/spec/integration/application/filebucket_spec.rb +11 -0
- data/spec/integration/application/module_spec.rb +21 -0
- data/spec/integration/application/resource_spec.rb +35 -1
- data/spec/integration/application/ssl_spec.rb +20 -0
- data/spec/integration/environments/settings_interpolation_spec.rb +0 -4
- data/spec/integration/indirector/facts/facter_spec.rb +90 -36
- data/spec/integration/type/exec_spec.rb +70 -45
- data/spec/lib/puppet/test_ca.rb +5 -0
- data/spec/lib/puppet_spec/settings.rb +1 -0
- data/spec/unit/environments_spec.rb +35 -0
- data/spec/unit/file_system_spec.rb +6 -0
- data/spec/unit/functions/assert_type_spec.rb +1 -1
- data/spec/unit/functions/empty_spec.rb +10 -0
- data/spec/unit/functions/unwrap_spec.rb +8 -0
- data/spec/unit/functions4_spec.rb +2 -2
- data/spec/unit/indirector/resource/ral_spec.rb +40 -75
- data/spec/unit/module_tool/applications/installer_spec.rb +12 -0
- data/spec/unit/parser/templatewrapper_spec.rb +12 -2
- data/spec/unit/provider/package/pip_spec.rb +37 -0
- data/spec/unit/provider/parsedfile_spec.rb +10 -0
- data/spec/unit/settings_spec.rb +97 -56
- data/spec/unit/type/exec_spec.rb +76 -29
- data/spec/unit/type/file/source_spec.rb +4 -4
- data/spec/unit/type/tidy_spec.rb +7 -0
- data/spec/unit/util/windows/sid_spec.rb +39 -4
- data/tasks/generate_cert_fixtures.rake +10 -1
- metadata +12 -3
@@ -90,9 +90,15 @@ module Puppet
|
|
90
90
|
raise Puppet::Error, "The file mode specification is invalid: #{value.inspect}"
|
91
91
|
end
|
92
92
|
|
93
|
+
# normalizes to symbolic form, e.g. u+a, an octal string without leading 0
|
93
94
|
normalize_symbolic_mode(value)
|
94
95
|
end
|
95
96
|
|
97
|
+
unmunge do |value|
|
98
|
+
# return symbolic form or octal string *with* leading 0's
|
99
|
+
display_mode(value) if value
|
100
|
+
end
|
101
|
+
|
96
102
|
def desired_mode_from_current(desired, current)
|
97
103
|
current = current.to_i(8) if current.is_a? String
|
98
104
|
is_a_directory = @resource.stat && @resource.stat.directory?
|
data/lib/puppet/type/tidy.rb
CHANGED
@@ -144,7 +144,7 @@ Puppet::Type.newtype(:tidy) do
|
|
144
144
|
|
145
145
|
def tidy?(path, stat)
|
146
146
|
# If the file's older than we allow, we should get rid of it.
|
147
|
-
(Time.now.to_i - stat.send(resource[:type]).to_i)
|
147
|
+
(Time.now.to_i - stat.send(resource[:type]).to_i) >= value
|
148
148
|
end
|
149
149
|
|
150
150
|
munge do |age|
|
@@ -19,25 +19,37 @@ module SymbolicFileMode
|
|
19
19
|
return false
|
20
20
|
end
|
21
21
|
|
22
|
+
def display_mode(value)
|
23
|
+
if value =~ /^0?[0-7]{1,4}$/
|
24
|
+
value.rjust(4, "0")
|
25
|
+
else
|
26
|
+
value
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
22
30
|
def normalize_symbolic_mode(value)
|
23
31
|
return nil if value.nil?
|
24
32
|
|
25
33
|
# We need to treat integers as octal numbers.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
34
|
+
#
|
35
|
+
# "A numeric mode is from one to four octal digits (0-7), derived by adding
|
36
|
+
# up the bits with values 4, 2, and 1. Omitted digits are assumed to be
|
37
|
+
# leading zeros."
|
38
|
+
if value.is_a? Numeric
|
39
|
+
value.to_s(8)
|
40
|
+
elsif value =~ /^0?[0-7]{1,4}$/
|
41
|
+
value.to_i(8).to_s(8) # strip leading 0's
|
30
42
|
else
|
31
|
-
|
43
|
+
value
|
32
44
|
end
|
33
45
|
end
|
34
46
|
|
35
47
|
def symbolic_mode_to_int(modification, to_mode = 0, is_a_directory = false)
|
36
|
-
if modification.nil? or modification == ''
|
48
|
+
if modification.nil? or modification == ''
|
37
49
|
raise Puppet::Error, _("An empty mode string is illegal")
|
38
|
-
|
39
|
-
|
40
|
-
|
50
|
+
elsif modification =~ /^[0-7]+$/
|
51
|
+
return modification.to_i(8)
|
52
|
+
elsif modification =~ /^\d+$/
|
41
53
|
raise Puppet::Error, _("Numeric modes must be in octal, not decimal!")
|
42
54
|
end
|
43
55
|
|
@@ -84,31 +96,31 @@ module SymbolicFileMode
|
|
84
96
|
|
85
97
|
dsl.split('').each do |op|
|
86
98
|
case op
|
87
|
-
when /[-+=]/
|
99
|
+
when /[-+=]/
|
88
100
|
action = op
|
89
101
|
# Clear all bits, if this is assignment
|
90
102
|
value = 0 if op == '='
|
91
103
|
|
92
|
-
when /[ugo]/
|
104
|
+
when /[ugo]/
|
93
105
|
value = actions[action].call(value, snapshot_mode[op])
|
94
106
|
|
95
|
-
when /[rwx]/
|
107
|
+
when /[rwx]/
|
96
108
|
value = actions[action].call(value, SymbolicMode[op])
|
97
109
|
|
98
|
-
when 'X'
|
110
|
+
when 'X'
|
99
111
|
# Only meaningful in combination with "set" actions.
|
100
|
-
if action != '+'
|
112
|
+
if action != '+'
|
101
113
|
raise Puppet::Error, _("X only works with the '+' operator")
|
102
114
|
end
|
103
115
|
|
104
116
|
# As per the BSD manual page, set if this is a directory, or if
|
105
117
|
# any execute bit is set on the original (unmodified) mode.
|
106
118
|
# Ignored otherwise; it is "add if", not "add or clear".
|
107
|
-
if is_a_directory or original_mode['any x?']
|
119
|
+
if is_a_directory or original_mode['any x?']
|
108
120
|
value = actions[action].call(value, ExecBit)
|
109
121
|
end
|
110
122
|
|
111
|
-
when /[st]/
|
123
|
+
when /[st]/
|
112
124
|
bit = SymbolicSpecialToBit[op][who] or fail _("internal error")
|
113
125
|
final_mode['s'] = actions[action].call(final_mode['s'], bit)
|
114
126
|
|
@@ -122,7 +134,7 @@ module SymbolicFileMode
|
|
122
134
|
end
|
123
135
|
|
124
136
|
rescue Puppet::Error => e
|
125
|
-
if part.inspect != modification.inspect
|
137
|
+
if part.inspect != modification.inspect
|
126
138
|
rest = " at #{part.inspect}"
|
127
139
|
else
|
128
140
|
rest = ''
|
@@ -75,7 +75,9 @@ module Puppet::Util::Windows
|
|
75
75
|
raw_sid_bytes = sid_ptr.read_array_of_uchar(get_length_sid(sid_ptr))
|
76
76
|
end
|
77
77
|
rescue => e
|
78
|
-
|
78
|
+
# Avoid debug logs pollution with valid account names
|
79
|
+
# https://docs.microsoft.com/en-us/windows/win32/api/sddl/nf-sddl-convertstringsidtosidw#return-value
|
80
|
+
Puppet.debug("Could not retrieve raw SID bytes from '#{name}': #{e.message}") unless e.code == ERROR_INVALID_SID_STRUCTURE
|
79
81
|
end
|
80
82
|
|
81
83
|
raw_sid_bytes ? Principal.lookup_account_sid(raw_sid_bytes) : Principal.lookup_account_name(name)
|
data/lib/puppet/version.rb
CHANGED
data/lib/puppet.rb
CHANGED
@@ -205,9 +205,9 @@ module Puppet
|
|
205
205
|
|
206
206
|
Facter.add(:agent_specified_environment) do
|
207
207
|
setcode do
|
208
|
-
|
209
|
-
Puppet
|
210
|
-
|
208
|
+
Puppet.settings.set_by_cli(:environment) ||
|
209
|
+
Puppet.settings.set_in_section(:environment, :agent) ||
|
210
|
+
Puppet.settings.set_in_section(:environment, :main)
|
211
211
|
end
|
212
212
|
end
|
213
213
|
end
|