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.

Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +5 -5
  3. data/Gemfile.lock +8 -8
  4. data/README.md +4 -4
  5. data/ext/project_data.yaml +1 -0
  6. data/lib/puppet/application/filebucket.rb +1 -0
  7. data/lib/puppet/application/resource.rb +15 -2
  8. data/lib/puppet/application/ssl.rb +1 -0
  9. data/lib/puppet/environments.rb +10 -0
  10. data/lib/puppet/face/help/action.erb +1 -0
  11. data/lib/puppet/face/help/face.erb +1 -0
  12. data/lib/puppet/face/node/clean.rb +11 -0
  13. data/lib/puppet/file_system/file_impl.rb +1 -1
  14. data/lib/puppet/file_system/windows.rb +2 -2
  15. data/lib/puppet/forge.rb +3 -3
  16. data/lib/puppet/functions/empty.rb +8 -0
  17. data/lib/puppet/functions/strftime.rb +1 -0
  18. data/lib/puppet/functions/unwrap.rb +17 -2
  19. data/lib/puppet/indirector/resource/ral.rb +6 -1
  20. data/lib/puppet/interface/documentation.rb +1 -0
  21. data/lib/puppet/module_tool/applications/installer.rb +4 -0
  22. data/lib/puppet/module_tool/errors/shared.rb +17 -0
  23. data/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
  24. data/lib/puppet/provider/exec/posix.rb +16 -4
  25. data/lib/puppet/provider/package/pip.rb +15 -3
  26. data/lib/puppet/provider/parsedfile.rb +3 -0
  27. data/lib/puppet/settings.rb +30 -7
  28. data/lib/puppet/type/exec.rb +16 -3
  29. data/lib/puppet/type/file/mode.rb +6 -0
  30. data/lib/puppet/type/tidy.rb +1 -1
  31. data/lib/puppet/util/symbolic_file_mode.rb +29 -17
  32. data/lib/puppet/util/windows/sid.rb +3 -1
  33. data/lib/puppet/version.rb +1 -1
  34. data/lib/puppet.rb +3 -3
  35. data/locales/puppet.pot +154 -134
  36. data/man/man5/puppet.conf.5 +2 -2
  37. data/man/man8/puppet-agent.8 +1 -1
  38. data/man/man8/puppet-apply.8 +1 -1
  39. data/man/man8/puppet-catalog.8 +9 -9
  40. data/man/man8/puppet-config.8 +1 -1
  41. data/man/man8/puppet-describe.8 +1 -1
  42. data/man/man8/puppet-device.8 +1 -1
  43. data/man/man8/puppet-doc.8 +1 -1
  44. data/man/man8/puppet-epp.8 +1 -1
  45. data/man/man8/puppet-facts.8 +8 -8
  46. data/man/man8/puppet-filebucket.8 +1 -1
  47. data/man/man8/puppet-generate.8 +1 -1
  48. data/man/man8/puppet-help.8 +1 -1
  49. data/man/man8/puppet-key.8 +7 -7
  50. data/man/man8/puppet-lookup.8 +1 -1
  51. data/man/man8/puppet-man.8 +1 -1
  52. data/man/man8/puppet-module.8 +1 -1
  53. data/man/man8/puppet-node.8 +5 -5
  54. data/man/man8/puppet-parser.8 +1 -1
  55. data/man/man8/puppet-plugin.8 +1 -1
  56. data/man/man8/puppet-report.8 +5 -5
  57. data/man/man8/puppet-resource.8 +1 -1
  58. data/man/man8/puppet-script.8 +1 -1
  59. data/man/man8/puppet-ssl.8 +1 -1
  60. data/man/man8/puppet-status.8 +4 -4
  61. data/man/man8/puppet.8 +2 -2
  62. data/spec/fixtures/ssl/127.0.0.1-key.pem +106 -106
  63. data/spec/fixtures/ssl/127.0.0.1.pem +48 -48
  64. data/spec/fixtures/ssl/bad-basic-constraints.pem +54 -54
  65. data/spec/fixtures/ssl/bad-int-basic-constraints.pem +51 -51
  66. data/spec/fixtures/ssl/ca.pem +52 -52
  67. data/spec/fixtures/ssl/crl.pem +25 -25
  68. data/spec/fixtures/ssl/ec-key.pem +11 -11
  69. data/spec/fixtures/ssl/ec.pem +32 -32
  70. data/spec/fixtures/ssl/encrypted-ec-key.pem +12 -12
  71. data/spec/fixtures/ssl/encrypted-key.pem +107 -107
  72. data/spec/fixtures/ssl/intermediate-agent-crl.pem +25 -25
  73. data/spec/fixtures/ssl/intermediate-agent.pem +54 -54
  74. data/spec/fixtures/ssl/intermediate-crl.pem +28 -28
  75. data/spec/fixtures/ssl/intermediate.pem +51 -51
  76. data/spec/fixtures/ssl/oid-key.pem +117 -0
  77. data/spec/fixtures/ssl/oid.pem +69 -0
  78. data/spec/fixtures/ssl/pluto-key.pem +106 -106
  79. data/spec/fixtures/ssl/pluto.pem +50 -50
  80. data/spec/fixtures/ssl/request-key.pem +106 -106
  81. data/spec/fixtures/ssl/request.pem +45 -45
  82. data/spec/fixtures/ssl/revoked-key.pem +106 -106
  83. data/spec/fixtures/ssl/revoked.pem +49 -49
  84. data/spec/fixtures/ssl/signed-key.pem +106 -106
  85. data/spec/fixtures/ssl/signed.pem +47 -47
  86. data/spec/fixtures/ssl/tampered-cert.pem +49 -49
  87. data/spec/fixtures/ssl/tampered-csr.pem +45 -45
  88. data/spec/fixtures/ssl/trusted_oid_mapping.yaml +5 -0
  89. data/spec/fixtures/ssl/unknown-127.0.0.1-key.pem +106 -106
  90. data/spec/fixtures/ssl/unknown-127.0.0.1.pem +48 -48
  91. data/spec/fixtures/ssl/unknown-ca-key.pem +106 -106
  92. data/spec/fixtures/ssl/unknown-ca.pem +52 -52
  93. data/spec/integration/application/filebucket_spec.rb +11 -0
  94. data/spec/integration/application/module_spec.rb +21 -0
  95. data/spec/integration/application/resource_spec.rb +35 -1
  96. data/spec/integration/application/ssl_spec.rb +20 -0
  97. data/spec/integration/environments/settings_interpolation_spec.rb +0 -4
  98. data/spec/integration/indirector/facts/facter_spec.rb +90 -36
  99. data/spec/integration/type/exec_spec.rb +70 -45
  100. data/spec/lib/puppet/test_ca.rb +5 -0
  101. data/spec/lib/puppet_spec/settings.rb +1 -0
  102. data/spec/unit/environments_spec.rb +35 -0
  103. data/spec/unit/file_system_spec.rb +6 -0
  104. data/spec/unit/functions/assert_type_spec.rb +1 -1
  105. data/spec/unit/functions/empty_spec.rb +10 -0
  106. data/spec/unit/functions/unwrap_spec.rb +8 -0
  107. data/spec/unit/functions4_spec.rb +2 -2
  108. data/spec/unit/indirector/resource/ral_spec.rb +40 -75
  109. data/spec/unit/module_tool/applications/installer_spec.rb +12 -0
  110. data/spec/unit/parser/templatewrapper_spec.rb +12 -2
  111. data/spec/unit/provider/package/pip_spec.rb +37 -0
  112. data/spec/unit/provider/parsedfile_spec.rb +10 -0
  113. data/spec/unit/settings_spec.rb +97 -56
  114. data/spec/unit/type/exec_spec.rb +76 -29
  115. data/spec/unit/type/file/source_spec.rb +4 -4
  116. data/spec/unit/type/tidy_spec.rb +7 -0
  117. data/spec/unit/util/windows/sid_spec.rb +39 -4
  118. data/tasks/generate_cert_fixtures.rake +10 -1
  119. 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?
@@ -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) > value
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
- if value.is_a? Numeric then
27
- return value.to_s(8)
28
- elsif value =~ /^0?[0-7]{1,4}$/ then
29
- return value.to_i(8).to_s(8)
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
- return value
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 == '' then
48
+ if modification.nil? or modification == ''
37
49
  raise Puppet::Error, _("An empty mode string is illegal")
38
- end
39
- if modification =~ /^[0-7]+$/ then return modification.to_i(8) end
40
- if modification =~ /^\d+$/ then
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 /[-+=]/ then
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]/ then
104
+ when /[ugo]/
93
105
  value = actions[action].call(value, snapshot_mode[op])
94
106
 
95
- when /[rwx]/ then
107
+ when /[rwx]/
96
108
  value = actions[action].call(value, SymbolicMode[op])
97
109
 
98
- when 'X' then
110
+ when 'X'
99
111
  # Only meaningful in combination with "set" actions.
100
- if action != '+' then
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?'] then
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]/ then
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 then
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
- Puppet.debug("Could not retrieve raw SID bytes from '#{name}': #{e.message}")
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)
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
 
8
8
  module Puppet
9
- PUPPETVERSION = '6.23.0'
9
+ PUPPETVERSION = '6.24.0'
10
10
 
11
11
  ##
12
12
  # version is a public API method intended to always provide a fast and
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
- if Puppet.settings.set_by_config?(:environment)
209
- Puppet[:environment]
210
- end
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