puppet 5.5.19-universal-darwin → 5.5.20-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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -11
  3. data/lib/puppet/agent.rb +2 -10
  4. data/lib/puppet/functions/reduce.rb +2 -4
  5. data/lib/puppet/provider/group/windows_adsi.rb +3 -3
  6. data/lib/puppet/provider/package/aix.rb +17 -2
  7. data/lib/puppet/provider/package/dnfmodule.rb +39 -12
  8. data/lib/puppet/provider/package/pkgdmg.rb +1 -1
  9. data/lib/puppet/provider/package/pkgng.rb +16 -4
  10. data/lib/puppet/provider/package/yum.rb +18 -15
  11. data/lib/puppet/provider/selmodule/semodule.rb +43 -26
  12. data/lib/puppet/provider/service/systemd.rb +1 -1
  13. data/lib/puppet/type/package.rb +20 -0
  14. data/lib/puppet/util/pidlock.rb +12 -6
  15. data/lib/puppet/util/windows/adsi.rb +2 -2
  16. data/lib/puppet/util/windows/process.rb +16 -15
  17. data/lib/puppet/util/windows/security.rb +1 -0
  18. data/lib/puppet/util/windows/sid.rb +3 -3
  19. data/lib/puppet/version.rb +1 -1
  20. data/locales/puppet.pot +103 -95
  21. data/man/man5/puppet.conf.5 +2 -2
  22. data/man/man8/puppet-agent.8 +1 -1
  23. data/man/man8/puppet-apply.8 +1 -1
  24. data/man/man8/puppet-ca.8 +1 -1
  25. data/man/man8/puppet-catalog.8 +1 -1
  26. data/man/man8/puppet-cert.8 +1 -1
  27. data/man/man8/puppet-certificate.8 +1 -1
  28. data/man/man8/puppet-certificate_request.8 +1 -1
  29. data/man/man8/puppet-certificate_revocation_list.8 +1 -1
  30. data/man/man8/puppet-config.8 +1 -1
  31. data/man/man8/puppet-describe.8 +1 -1
  32. data/man/man8/puppet-device.8 +1 -1
  33. data/man/man8/puppet-doc.8 +1 -1
  34. data/man/man8/puppet-epp.8 +1 -1
  35. data/man/man8/puppet-facts.8 +1 -1
  36. data/man/man8/puppet-filebucket.8 +1 -1
  37. data/man/man8/puppet-generate.8 +1 -1
  38. data/man/man8/puppet-help.8 +1 -1
  39. data/man/man8/puppet-key.8 +1 -1
  40. data/man/man8/puppet-lookup.8 +1 -1
  41. data/man/man8/puppet-man.8 +1 -1
  42. data/man/man8/puppet-master.8 +1 -1
  43. data/man/man8/puppet-module.8 +1 -1
  44. data/man/man8/puppet-node.8 +1 -1
  45. data/man/man8/puppet-parser.8 +1 -1
  46. data/man/man8/puppet-plugin.8 +1 -1
  47. data/man/man8/puppet-report.8 +1 -1
  48. data/man/man8/puppet-resource.8 +1 -1
  49. data/man/man8/puppet-script.8 +1 -1
  50. data/man/man8/puppet-status.8 +1 -1
  51. data/man/man8/puppet.8 +2 -2
  52. data/spec/fixtures/unit/provider/package/dnfmodule/{dnf-module-list-installed.txt → dnf-module-list-enabled.txt} +2 -0
  53. data/spec/fixtures/unit/provider/package/pkgng/pkg.version +2 -0
  54. data/spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt +9 -0
  55. data/spec/integration/util/windows/adsi_spec.rb +1 -1
  56. data/spec/unit/agent_spec.rb +33 -25
  57. data/spec/unit/provider/group/windows_adsi_spec.rb +43 -10
  58. data/spec/unit/provider/package/aix_spec.rb +29 -0
  59. data/spec/unit/provider/package/dnfmodule_spec.rb +33 -14
  60. data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
  61. data/spec/unit/provider/package/pkgng_spec.rb +36 -0
  62. data/spec/unit/provider/package/yum_spec.rb +10 -1
  63. data/spec/unit/provider/selmodule_spec.rb +118 -47
  64. data/spec/unit/provider/user/windows_adsi_spec.rb +3 -3
  65. data/spec/unit/util/pidlock_spec.rb +67 -40
  66. data/spec/unit/util/windows/adsi_spec.rb +4 -4
  67. data/spec/unit/util/windows/sid_spec.rb +2 -2
  68. metadata +6 -4
@@ -78,9 +78,9 @@ describe Puppet::Type.type(:user).provider(:windows_adsi), :if => Puppet.feature
78
78
  let(:group3) { double(:account => 'group3', :domain => '.', :sid => 'group3sid') }
79
79
 
80
80
  before :each do
81
- allow(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('group1').and_return(group1)
82
- allow(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('group2').and_return(group2)
83
- allow(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('group3').and_return(group3)
81
+ allow(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('group1', any_args).and_return(group1)
82
+ allow(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('group2', any_args).and_return(group2)
83
+ allow(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('group3', any_args).and_return(group3)
84
84
  end
85
85
 
86
86
  it "should return true for same lists of members" do
@@ -22,23 +22,6 @@ describe Puppet::Util::Pidlock do
22
22
 
23
23
  it "should become locked" do
24
24
  @lock.lock
25
- if Puppet::Util::Platform.windows?
26
- allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(@lock.lock_pid).and_return('C:\Program Files\Puppet Labs\Puppet\puppet\bin\ruby.exe')
27
- else
28
- allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'comm=']).and_return('puppet')
29
- allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'args=']).and_return('puppet')
30
- end
31
- expect(@lock).to be_locked
32
- end
33
-
34
- it "should become locked if puppet is a gem" do
35
- @lock.lock
36
- unless Puppet::Util::Platform.windows?
37
- expect(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'comm=']).and_return('ruby')
38
- expect(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'args=']).and_return('ruby /root/puppet/.bundle/ruby/2.3.0/bin/puppet agent --no-daemonize -v')
39
- else
40
- allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(@lock.lock_pid).and_return('C:\tools\ruby25\bin\ruby.exe')
41
- end
42
25
  expect(@lock).to be_locked
43
26
  end
44
27
 
@@ -117,23 +100,6 @@ describe Puppet::Util::Pidlock do
117
100
  describe "#locked?" do
118
101
  it "should return true if locked" do
119
102
  @lock.lock
120
- if Puppet::Util::Platform.windows?
121
- allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(@lock.lock_pid).and_return('C:\Program Files\Puppet Labs\Puppet\puppet\bin\ruby.exe')
122
- else
123
- allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'comm=']).and_return('puppet')
124
- allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'args=']).and_return('puppet')
125
- end
126
- expect(@lock).to be_locked
127
- end
128
-
129
- it "should return true if locked when puppet as gem" do
130
- @lock.lock
131
- unless Puppet::Util::Platform.windows?
132
- expect(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'comm=']).and_return('ruby')
133
- expect(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', @lock.lock_pid, '-o', 'args=']).and_return('ruby /root/puppet/.bundle/ruby/2.3.0/bin/puppet agent --no-daemonize -v')
134
- else
135
- allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(@lock.lock_pid).and_return('C:\tools\ruby25\bin\ruby.exe')
136
- end
137
103
  expect(@lock).to be_locked
138
104
  end
139
105
 
@@ -179,12 +145,6 @@ describe Puppet::Util::Pidlock do
179
145
  end
180
146
 
181
147
  it "should replace with new locks" do
182
- if Puppet::Util::Platform.windows?
183
- allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(6789).and_return('C:\Program Files\Puppet Labs\Puppet\puppet\bin\ruby.exe')
184
- else
185
- allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', 6789, '-o', 'comm=']).and_return('puppet')
186
- allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', 6789, '-o', 'args=']).and_return('puppet')
187
- end
188
148
  @lock.lock
189
149
  expect(Puppet::FileSystem.exist?(@lockfile)).to be_truthy
190
150
  expect(@lock.lock_pid).to eq(6789)
@@ -205,6 +165,49 @@ describe Puppet::Util::Pidlock do
205
165
  end
206
166
  end
207
167
 
168
+ describe "with no access to open the process on Windows", :if => Puppet.features.microsoft_windows? do
169
+ before(:each) do
170
+ allow(Process).to receive(:pid).and_return(6789)
171
+ @lock.lock
172
+ allow(Process).to receive(:pid).and_return(1234)
173
+ exception = Puppet::Util::Windows::Error.new('Access Denied', 5) # ERROR_ACCESS_DENIED
174
+ allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(6789).and_raise(exception)
175
+ allow(Process).to receive(:kill).with(0, 6789)
176
+ allow(Process).to receive(:kill).with(0, 1234)
177
+ end
178
+
179
+ it "should be locked" do
180
+ expect(@lock).to be_locked
181
+ end
182
+
183
+ describe "#lock" do
184
+ it "should not be possible" do
185
+ expect(@lock.lock).to be_falsey
186
+ end
187
+
188
+ it "should not overwrite the lock" do
189
+ @lock.lock
190
+ expect(@lock).not_to be_mine
191
+ end
192
+ end
193
+
194
+ describe "#unlock" do
195
+ it "should not be possible" do
196
+ expect(@lock.unlock).to be_falsey
197
+ end
198
+
199
+ it "should not remove the lock file" do
200
+ @lock.unlock
201
+ expect(Puppet::FileSystem.exist?(@lockfile)).to be_truthy
202
+ end
203
+
204
+ it "should still not be our lock" do
205
+ @lock.unlock
206
+ expect(@lock).not_to be_mine
207
+ end
208
+ end
209
+ end
210
+
208
211
  describe "with another process lock" do
209
212
  before(:each) do
210
213
  # fake our pid to be 1234
@@ -233,6 +236,30 @@ describe Puppet::Util::Pidlock do
233
236
  expect(@lock).not_to be_mine
234
237
  end
235
238
 
239
+ it "should be locked if the other process is a puppet gem" do
240
+ File.write(@lockfile, "1234")
241
+
242
+ if Puppet::Util::Platform.windows?
243
+ allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(1234).and_return('C:\Program Files\Puppet Labs\Puppet\puppet\bin\ruby.exe')
244
+ else
245
+ allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', 1234, '-o', 'comm=']).and_return('ruby')
246
+ allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', 1234, '-o', 'args=']).and_return('ruby /root/puppet/.bundle/ruby/2.3.0/bin/puppet agent --no-daemonize -v')
247
+ end
248
+ expect(@lock).to be_locked
249
+ end
250
+
251
+ it "should not be mine if the other process is a puppet gem" do
252
+ File.write(@lockfile, "1234")
253
+
254
+ if Puppet::Util::Platform.windows?
255
+ allow(Puppet::Util::Windows::Process).to receive(:get_process_image_name_by_pid).with(1234).and_return('C:\Program Files\Puppet Labs\Puppet\puppet\bin\ruby.exe')
256
+ else
257
+ allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', 1234, '-o', 'comm=']).and_return('ruby')
258
+ allow(Puppet::Util::Execution).to receive(:execute).with(['ps', '-p', 1234, '-o', 'args=']).and_return('ruby /root/puppet/.bundle/ruby/2.3.0/bin/puppet agent --no-daemonize -v')
259
+ end
260
+ expect(@lock).to_not be_mine
261
+ end
262
+
236
263
  describe "#lock" do
237
264
  it "should not be possible" do
238
265
  expect(@lock.lock).to be_falsey
@@ -466,8 +466,8 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet.features.microsoft_windows?
466
466
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([0]).and_return(sids[0])
467
467
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([1]).and_return(sids[1])
468
468
 
469
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2').and_return(sids[1])
470
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3').and_return(sids[2])
469
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2', false).and_return(sids[1])
470
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3', false).and_return(sids[2])
471
471
 
472
472
  expect(Puppet::Util::Windows::ADSI).to receive(:sid_uri).with(sids[0]).and_return("WinNT://DOMAIN/user1,user")
473
473
  expect(Puppet::Util::Windows::ADSI).to receive(:sid_uri).with(sids[2]).and_return("WinNT://DOMAIN2/user3,user")
@@ -493,8 +493,8 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet.features.microsoft_windows?
493
493
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([0]).and_return(sids[0])
494
494
  expect(Puppet::Util::Windows::SID).to receive(:octet_string_to_principal).with([1]).and_return(sids[1])
495
495
 
496
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2').and_return(sids[1])
497
- expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3').and_return(sids[2])
496
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('user2', any_args).and_return(sids[1])
497
+ expect(Puppet::Util::Windows::SID).to receive(:name_to_principal).with('DOMAIN2\user3', any_args).and_return(sids[2])
498
498
 
499
499
  expect(Puppet::Util::Windows::ADSI).to receive(:sid_uri).with(sids[2]).and_return("WinNT://DOMAIN2/user3,user")
500
500
 
@@ -201,9 +201,9 @@ describe "Puppet::Util::Windows::SID", :if => Puppet.features.microsoft_windows?
201
201
  principal = subject.ads_to_principal(unresolvable_user)
202
202
 
203
203
  expect(principal).to be_an_instance_of(Puppet::Util::Windows::SID::Principal)
204
- expect(principal.account).to eq('S-1-1-1 (unresolvable)')
204
+ expect(principal.account).to eq('S-1-1-1')
205
205
  expect(principal.domain).to eq(nil)
206
- expect(principal.domain_account).to eq('S-1-1-1 (unresolvable)')
206
+ expect(principal.domain_account).to eq('S-1-1-1')
207
207
  expect(principal.sid).to eq('S-1-1-1')
208
208
  expect(principal.sid_bytes).to eq(valid_octet_invalid_user)
209
209
  expect(principal.account_type).to eq(:SidTypeUnknown)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.19
4
+ version: 5.5.20
5
5
  platform: universal-darwin
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-06 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -1730,7 +1730,7 @@ files:
1730
1730
  - spec/fixtures/unit/provider/mount/parsed/solaris.fstab
1731
1731
  - spec/fixtures/unit/provider/mount/parsed/solaris.mount
1732
1732
  - spec/fixtures/unit/provider/naginator/define_empty_param
1733
- - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt
1733
+ - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-enabled.txt
1734
1734
  - spec/fixtures/unit/provider/package/gem/gem-list-single-package
1735
1735
  - spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
1736
1736
  - spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
@@ -1759,6 +1759,7 @@ files:
1759
1759
  - spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt
1760
1760
  - spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt
1761
1761
  - spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
1762
+ - spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt
1762
1763
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
1763
1764
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
1764
1765
  - spec/fixtures/unit/provider/parsedfile/simple.txt
@@ -3048,7 +3049,7 @@ test_files:
3048
3049
  - spec/fixtures/unit/provider/mount/parsed/solaris.fstab
3049
3050
  - spec/fixtures/unit/provider/mount/parsed/solaris.mount
3050
3051
  - spec/fixtures/unit/provider/naginator/define_empty_param
3051
- - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt
3052
+ - spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-enabled.txt
3052
3053
  - spec/fixtures/unit/provider/package/gem/gem-list-single-package
3053
3054
  - spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
3054
3055
  - spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
@@ -3077,6 +3078,7 @@ test_files:
3077
3078
  - spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt
3078
3079
  - spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt
3079
3080
  - spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
3081
+ - spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt
3080
3082
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
3081
3083
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
3082
3084
  - spec/fixtures/unit/provider/parsedfile/simple.txt