puppet 5.5.19-x86-mingw32 → 5.5.20-x86-mingw32
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/Gemfile.lock +11 -11
- data/lib/puppet/agent.rb +2 -10
- data/lib/puppet/functions/reduce.rb +2 -4
- data/lib/puppet/provider/group/windows_adsi.rb +3 -3
- data/lib/puppet/provider/package/aix.rb +17 -2
- data/lib/puppet/provider/package/dnfmodule.rb +39 -12
- data/lib/puppet/provider/package/pkgdmg.rb +1 -1
- data/lib/puppet/provider/package/pkgng.rb +16 -4
- data/lib/puppet/provider/package/yum.rb +18 -15
- data/lib/puppet/provider/selmodule/semodule.rb +43 -26
- data/lib/puppet/provider/service/systemd.rb +1 -1
- data/lib/puppet/type/package.rb +20 -0
- data/lib/puppet/util/pidlock.rb +12 -6
- data/lib/puppet/util/windows/adsi.rb +2 -2
- data/lib/puppet/util/windows/process.rb +16 -15
- data/lib/puppet/util/windows/security.rb +1 -0
- data/lib/puppet/util/windows/sid.rb +3 -3
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +103 -95
- 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-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- 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 +1 -1
- 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 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/package/dnfmodule/{dnf-module-list-installed.txt → dnf-module-list-enabled.txt} +2 -0
- data/spec/fixtures/unit/provider/package/pkgng/pkg.version +2 -0
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt +9 -0
- data/spec/integration/util/windows/adsi_spec.rb +1 -1
- data/spec/unit/agent_spec.rb +33 -25
- data/spec/unit/provider/group/windows_adsi_spec.rb +43 -10
- data/spec/unit/provider/package/aix_spec.rb +29 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +33 -14
- data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
- data/spec/unit/provider/package/pkgng_spec.rb +36 -0
- data/spec/unit/provider/package/yum_spec.rb +10 -1
- data/spec/unit/provider/selmodule_spec.rb +118 -47
- data/spec/unit/provider/user/windows_adsi_spec.rb +3 -3
- data/spec/unit/util/pidlock_spec.rb +67 -40
- data/spec/unit/util/windows/adsi_spec.rb +4 -4
- data/spec/unit/util/windows/sid_spec.rb +2 -2
- 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
|
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
|
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.
|
4
|
+
version: 5.5.20
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -1800,7 +1800,7 @@ files:
|
|
1800
1800
|
- spec/fixtures/unit/provider/mount/parsed/solaris.fstab
|
1801
1801
|
- spec/fixtures/unit/provider/mount/parsed/solaris.mount
|
1802
1802
|
- spec/fixtures/unit/provider/naginator/define_empty_param
|
1803
|
-
- spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-
|
1803
|
+
- spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-enabled.txt
|
1804
1804
|
- spec/fixtures/unit/provider/package/gem/gem-list-single-package
|
1805
1805
|
- spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
|
1806
1806
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
|
@@ -1829,6 +1829,7 @@ files:
|
|
1829
1829
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt
|
1830
1830
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt
|
1831
1831
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
1832
|
+
- spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt
|
1832
1833
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
1833
1834
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
1834
1835
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
@@ -3118,7 +3119,7 @@ test_files:
|
|
3118
3119
|
- spec/fixtures/unit/provider/mount/parsed/solaris.fstab
|
3119
3120
|
- spec/fixtures/unit/provider/mount/parsed/solaris.mount
|
3120
3121
|
- spec/fixtures/unit/provider/naginator/define_empty_param
|
3121
|
-
- spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-
|
3122
|
+
- spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-enabled.txt
|
3122
3123
|
- spec/fixtures/unit/provider/package/gem/gem-list-single-package
|
3123
3124
|
- spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
|
3124
3125
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
|
@@ -3147,6 +3148,7 @@ test_files:
|
|
3147
3148
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-plugin-output.txt
|
3148
3149
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt
|
3149
3150
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
3151
|
+
- spec/fixtures/unit/provider/package/yum/yum-check-update-subscription-manager.txt
|
3150
3152
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
3151
3153
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
3152
3154
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|