puppet 7.0.0-x64-mingw32 → 7.5.0-x64-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/CODEOWNERS +2 -16
- data/Gemfile +2 -3
- data/Gemfile.lock +45 -33
- data/ext/build_defaults.yaml +0 -1
- data/ext/project_data.yaml +1 -0
- data/lib/puppet/application.rb +10 -6
- data/lib/puppet/application/agent.rb +1 -0
- data/lib/puppet/application/apply.rb +3 -2
- data/lib/puppet/application/device.rb +1 -0
- data/lib/puppet/application/script.rb +1 -0
- data/lib/puppet/application/ssl.rb +11 -0
- data/lib/puppet/application_support.rb +7 -0
- data/lib/puppet/configurer.rb +16 -3
- data/lib/puppet/defaults.rb +14 -41
- data/lib/puppet/environments.rb +54 -55
- data/lib/puppet/face/facts.rb +26 -2
- data/lib/puppet/face/node/clean.rb +8 -0
- data/lib/puppet/ffi/posix.rb +10 -0
- data/lib/puppet/ffi/posix/constants.rb +14 -0
- data/lib/puppet/ffi/posix/functions.rb +24 -0
- data/lib/puppet/ffi/windows/api_types.rb +1 -1
- data/lib/puppet/ffi/windows/constants.rb +1 -1
- data/lib/puppet/file_serving/configuration/parser.rb +5 -2
- data/lib/puppet/file_system/memory_file.rb +8 -1
- data/lib/puppet/file_system/windows.rb +2 -0
- data/lib/puppet/http/factory.rb +4 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -0
- data/lib/puppet/module_tool/applications/installer.rb +48 -2
- data/lib/puppet/module_tool/errors/shared.rb +17 -2
- data/lib/puppet/network/formats.rb +67 -0
- data/lib/puppet/network/http.rb +5 -2
- data/lib/puppet/network/http/api.rb +10 -6
- data/lib/puppet/network/http/api/master.rb +3 -2
- data/lib/puppet/network/http/api/master/v3.rb +2 -25
- data/lib/puppet/network/http/api/master/v3/environments.rb +2 -33
- data/lib/puppet/network/http/api/server.rb +10 -0
- data/lib/puppet/network/http/api/server/v3.rb +39 -0
- data/lib/puppet/network/http/api/server/v3/environments.rb +48 -0
- data/lib/puppet/parser/ast/leaf.rb +3 -2
- data/lib/puppet/parser/templatewrapper.rb +1 -1
- data/lib/puppet/pops/evaluator/deferred_resolver.rb +5 -3
- data/lib/puppet/pops/model/ast_transformer.rb +1 -1
- data/lib/puppet/pops/parser/lexer2.rb +0 -4
- data/lib/puppet/pops/validation/checker4_0.rb +0 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +13 -8
- data/lib/puppet/provider/package/apt.rb +34 -2
- data/lib/puppet/provider/package/aptitude.rb +6 -0
- data/lib/puppet/provider/service/debian.rb +2 -0
- data/lib/puppet/provider/user/aix.rb +2 -2
- data/lib/puppet/provider/user/useradd.rb +62 -8
- data/lib/puppet/reference/configuration.rb +6 -5
- data/lib/puppet/settings.rb +33 -28
- data/lib/puppet/settings/alias_setting.rb +37 -0
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/type/package.rb +3 -3
- data/lib/puppet/type/user.rb +1 -1
- data/lib/puppet/util/autoload.rb +1 -8
- data/lib/puppet/util/monkey_patches.rb +7 -0
- data/lib/puppet/util/posix.rb +54 -5
- data/lib/puppet/util/windows/adsi.rb +46 -0
- data/lib/puppet/util/windows/principal.rb +9 -2
- data/lib/puppet/util/windows/sid.rb +4 -2
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +166 -146
- data/man/man5/puppet.conf.5 +14 -6
- data/man/man8/puppet-agent.8 +2 -2
- data/man/man8/puppet-apply.8 +2 -2
- data/man/man8/puppet-catalog.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 +2 -2
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +8 -2
- 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-lookup.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 +2 -2
- data/man/man8/puppet-ssl.8 +5 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/integration/application/agent/cached_deferred_catalog.json +91 -0
- data/spec/fixtures/unit/provider/user/aix/aix_passwd_file.out +4 -0
- data/spec/integration/application/agent_spec.rb +160 -3
- data/spec/integration/application/apply_spec.rb +19 -0
- data/spec/integration/application/plugin_spec.rb +1 -1
- data/spec/integration/defaults_spec.rb +0 -7
- data/spec/integration/http/client_spec.rb +12 -0
- data/spec/integration/indirector/direct_file_server_spec.rb +1 -3
- data/spec/integration/indirector/file_content/file_server_spec.rb +0 -2
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +0 -2
- data/spec/integration/parser/collection_spec.rb +10 -0
- data/spec/integration/resource/type_collection_spec.rb +2 -6
- data/spec/integration/transaction_spec.rb +4 -9
- data/spec/integration/util/windows/adsi_spec.rb +21 -1
- data/spec/integration/util/windows/principal_spec.rb +21 -0
- data/spec/integration/util/windows/registry_spec.rb +6 -10
- data/spec/spec_helper.rb +1 -4
- data/spec/unit/agent_spec.rb +8 -6
- data/spec/unit/application/agent_spec.rb +0 -1
- data/spec/unit/application/facts_spec.rb +58 -7
- data/spec/unit/application/filebucket_spec.rb +0 -2
- data/spec/unit/application/ssl_spec.rb +23 -0
- data/spec/unit/application_spec.rb +51 -9
- data/spec/unit/confine/feature_spec.rb +1 -1
- data/spec/unit/confine_spec.rb +8 -2
- data/spec/unit/defaults_spec.rb +1 -56
- data/spec/unit/environments_spec.rb +221 -68
- data/spec/unit/face/node_spec.rb +14 -13
- data/spec/unit/file_serving/configuration/parser_spec.rb +8 -1
- data/spec/unit/file_serving/metadata_spec.rb +3 -3
- data/spec/unit/file_serving/terminus_helper_spec.rb +11 -4
- data/spec/unit/file_system_spec.rb +9 -0
- data/spec/unit/forge/module_release_spec.rb +2 -7
- data/spec/unit/http/factory_spec.rb +19 -0
- data/spec/unit/indirector/face_spec.rb +0 -1
- data/spec/unit/indirector/facts/facter_spec.rb +20 -5
- data/spec/unit/indirector/file_bucket_file/selector_spec.rb +26 -8
- data/spec/unit/indirector/indirection_spec.rb +8 -12
- data/spec/unit/indirector_spec.rb +2 -2
- data/spec/unit/module_tool/applications/installer_spec.rb +66 -0
- data/spec/unit/network/formats_spec.rb +41 -0
- data/spec/unit/network/http/api/indirected_routes_spec.rb +0 -4
- data/spec/unit/network/http/api/master_spec.rb +38 -0
- data/spec/unit/network/http/api/{master → server}/v3/environments_spec.rb +2 -2
- data/spec/unit/network/http/api/{master → server}/v3_spec.rb +19 -19
- data/spec/unit/network/http/api_spec.rb +11 -11
- data/spec/unit/parser/compiler_spec.rb +3 -19
- data/spec/unit/parser/resource_spec.rb +14 -8
- data/spec/unit/parser/templatewrapper_spec.rb +4 -3
- data/spec/unit/pops/evaluator/deferred_resolver_spec.rb +20 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +0 -4
- data/spec/unit/pops/validator/validator_spec.rb +20 -43
- data/spec/unit/property_spec.rb +1 -0
- data/spec/unit/provider/group/groupadd_spec.rb +5 -2
- data/spec/unit/provider/nameservice_spec.rb +66 -65
- data/spec/unit/provider/package/apt_spec.rb +28 -23
- data/spec/unit/provider/package/aptitude_spec.rb +1 -1
- data/spec/unit/provider/package/base_spec.rb +6 -5
- data/spec/unit/provider/package/pacman_spec.rb +18 -12
- data/spec/unit/provider/package/pip_spec.rb +6 -11
- data/spec/unit/provider/package/pkgdmg_spec.rb +0 -4
- data/spec/unit/provider/user/aix_spec.rb +5 -0
- data/spec/unit/provider/user/hpux_spec.rb +1 -1
- data/spec/unit/provider/user/pw_spec.rb +2 -0
- data/spec/unit/provider/user/useradd_spec.rb +56 -3
- data/spec/unit/provider_spec.rb +6 -8
- data/spec/unit/resource/type_spec.rb +1 -1
- data/spec/unit/resource_spec.rb +11 -10
- data/spec/unit/settings_spec.rb +13 -6
- data/spec/unit/ssl/base_spec.rb +0 -1
- data/spec/unit/ssl/certificate_request_spec.rb +4 -10
- data/spec/unit/ssl/ssl_provider_spec.rb +5 -2
- data/spec/unit/transaction/additional_resource_generator_spec.rb +3 -7
- data/spec/unit/transaction/event_manager_spec.rb +14 -11
- data/spec/unit/transaction_spec.rb +13 -4
- data/spec/unit/type/file/content_spec.rb +0 -1
- data/spec/unit/type/file/selinux_spec.rb +0 -2
- data/spec/unit/type/file_spec.rb +0 -6
- data/spec/unit/type/group_spec.rb +13 -6
- data/spec/unit/type/resources_spec.rb +7 -7
- data/spec/unit/type/service_spec.rb +1 -1
- data/spec/unit/type/tidy_spec.rb +0 -1
- data/spec/unit/type_spec.rb +2 -2
- data/spec/unit/util/at_fork_spec.rb +2 -2
- data/spec/unit/util/autoload_spec.rb +5 -1
- data/spec/unit/util/backups_spec.rb +1 -2
- data/spec/unit/util/execution_spec.rb +15 -11
- data/spec/unit/util/inifile_spec.rb +6 -14
- data/spec/unit/util/log_spec.rb +8 -7
- data/spec/unit/util/logging_spec.rb +3 -3
- data/spec/unit/util/posix_spec.rb +363 -15
- data/spec/unit/util/selinux_spec.rb +76 -52
- data/spec/unit/util/storage_spec.rb +3 -1
- data/spec/unit/util/suidmanager_spec.rb +44 -41
- data/spec/unit/util/windows/sid_spec.rb +6 -0
- data/spec/unit/util_spec.rb +13 -6
- metadata +33 -16
- data/spec/lib/matchers/include.rb +0 -27
- data/spec/lib/matchers/include_spec.rb +0 -32
- data/spec/unit/pops/parser/parse_application_spec.rb +0 -13
- data/spec/unit/pops/parser/parse_capabilities_spec.rb +0 -23
- data/spec/unit/pops/parser/parse_site_spec.rb +0 -43
data/lib/puppet/environments.rb
CHANGED
@@ -225,6 +225,9 @@ module Puppet::Environments
|
|
225
225
|
private
|
226
226
|
|
227
227
|
def create_environment(name)
|
228
|
+
# interpolated modulepaths may be cached from prior environment instances
|
229
|
+
Puppet.settings.clear_environment_settings(name)
|
230
|
+
|
228
231
|
env_symbol = name.intern
|
229
232
|
setting_values = Puppet.settings.values(env_symbol, Puppet.settings.preferred_run_mode)
|
230
233
|
env = Puppet::Node::Environment.create(
|
@@ -346,17 +349,23 @@ module Puppet::Environments
|
|
346
349
|
@loader = loader
|
347
350
|
@cache_expiration_service = Puppet::Environments::Cached.cache_expiration_service
|
348
351
|
@cache = {}
|
349
|
-
|
350
|
-
# Holds expiration times in sorted order - next to expire is first
|
351
|
-
@expirations = SortedSet.new
|
352
|
-
|
353
|
-
# Infinity since it there are no entries, this is a cache of the first to expire time
|
354
|
-
@next_expiration = END_OF_TIME
|
355
352
|
end
|
356
353
|
|
357
354
|
# @!macro loader_list
|
358
355
|
def list
|
359
|
-
|
356
|
+
# Evict all that have expired, in the same way as `get`
|
357
|
+
clear_all_expired
|
358
|
+
|
359
|
+
@loader.list.map do |env|
|
360
|
+
name = env.name
|
361
|
+
old_entry = @cache[name]
|
362
|
+
if old_entry
|
363
|
+
old_entry.value
|
364
|
+
else
|
365
|
+
add_entry(name, entry(env))
|
366
|
+
env
|
367
|
+
end
|
368
|
+
end
|
360
369
|
end
|
361
370
|
|
362
371
|
# @!macro loader_search_paths
|
@@ -379,7 +388,6 @@ module Puppet::Environments
|
|
379
388
|
elsif (result = @loader.get(name))
|
380
389
|
# environment loaded, cache it
|
381
390
|
cache_entry = entry(result)
|
382
|
-
@cache_expiration_service.created(result)
|
383
391
|
add_entry(name, cache_entry)
|
384
392
|
result
|
385
393
|
end
|
@@ -389,28 +397,36 @@ module Puppet::Environments
|
|
389
397
|
def add_entry(name, cache_entry)
|
390
398
|
Puppet.debug {"Caching environment '#{name}' #{cache_entry.label}"}
|
391
399
|
@cache[name] = cache_entry
|
392
|
-
|
393
|
-
@expirations.add(expires)
|
394
|
-
if @next_expiration > expires
|
395
|
-
@next_expiration = expires
|
396
|
-
end
|
400
|
+
@cache_expiration_service.created(cache_entry.value)
|
397
401
|
end
|
398
402
|
private :add_entry
|
399
403
|
|
404
|
+
def clear_entry(name, entry)
|
405
|
+
@cache.delete(name)
|
406
|
+
Puppet.debug {"Evicting cache entry for environment '#{name}'"}
|
407
|
+
@cache_expiration_service.evicted(name.to_sym)
|
408
|
+
Puppet::GettextConfig.delete_text_domain(name)
|
409
|
+
Puppet.settings.clear_environment_settings(name)
|
410
|
+
end
|
411
|
+
private :clear_entry
|
412
|
+
|
400
413
|
# Clears the cache of the environment with the given name.
|
401
414
|
# (The intention is that this could be used from a MANUAL cache eviction command (TBD)
|
402
415
|
def clear(name)
|
403
|
-
@cache
|
404
|
-
|
416
|
+
entry = @cache[name]
|
417
|
+
clear_entry(name, entry) if entry
|
405
418
|
end
|
406
419
|
|
407
420
|
# Clears all cached environments.
|
408
421
|
# (The intention is that this could be used from a MANUAL cache eviction command (TBD)
|
409
|
-
def clear_all
|
422
|
+
def clear_all
|
410
423
|
super
|
424
|
+
|
425
|
+
@cache.each_pair do |name, entry|
|
426
|
+
clear_entry(name, entry)
|
427
|
+
end
|
428
|
+
|
411
429
|
@cache = {}
|
412
|
-
@expirations.clear
|
413
|
-
@next_expiration = END_OF_TIME
|
414
430
|
Puppet::GettextConfig.delete_environment_text_domains
|
415
431
|
end
|
416
432
|
|
@@ -419,18 +435,24 @@ module Puppet::Environments
|
|
419
435
|
#
|
420
436
|
def clear_all_expired()
|
421
437
|
t = Time.now
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
Puppet.debug {"Evicting cache entry for environment '#{name}'"}
|
426
|
-
@cache_expiration_service.evicted(name.to_sym)
|
427
|
-
clear(name)
|
428
|
-
@expirations.delete(entry.expires)
|
429
|
-
Puppet.settings.clear_environment_settings(name)
|
438
|
+
|
439
|
+
@cache.each_pair do |name, entry|
|
440
|
+
clear_if_expired(name, entry, t)
|
430
441
|
end
|
431
|
-
@next_expiration = @expirations.first || END_OF_TIME
|
432
442
|
end
|
433
443
|
|
444
|
+
# Clear an environment if it is expired, either by exceeding its time to live, or
|
445
|
+
# through an explicit eviction determined by the cache expiration service.
|
446
|
+
#
|
447
|
+
def clear_if_expired(name, entry, t = Time.now)
|
448
|
+
return unless entry
|
449
|
+
|
450
|
+
if entry.expired?(t) || @cache_expiration_service.expired?(name.to_sym)
|
451
|
+
clear_entry(name, entry)
|
452
|
+
end
|
453
|
+
end
|
454
|
+
private :clear_if_expired
|
455
|
+
|
434
456
|
# This implementation evicts the cache, and always gets the current
|
435
457
|
# configuration of the environment
|
436
458
|
#
|
@@ -440,7 +462,7 @@ module Puppet::Environments
|
|
440
462
|
#
|
441
463
|
# @!macro loader_get_conf
|
442
464
|
def get_conf(name)
|
443
|
-
|
465
|
+
clear_if_expired(name, @cache[name])
|
444
466
|
@loader.get_conf(name)
|
445
467
|
end
|
446
468
|
|
@@ -463,17 +485,6 @@ module Puppet::Environments
|
|
463
485
|
end
|
464
486
|
end
|
465
487
|
|
466
|
-
# Evicts the entry if it has expired
|
467
|
-
# Also clears caches in Settings that may prevent the entry from being updated
|
468
|
-
def evict_if_expired(name)
|
469
|
-
if (result = @cache[name]) && (result.expired? || @cache_expiration_service.expired?(name.to_sym))
|
470
|
-
Puppet.debug {"Evicting cache entry for environment '#{name}'"}
|
471
|
-
@cache_expiration_service.evicted(name.to_sym)
|
472
|
-
clear(name)
|
473
|
-
Puppet.settings.clear_environment_settings(name)
|
474
|
-
end
|
475
|
-
end
|
476
|
-
|
477
488
|
# Never evicting entry
|
478
489
|
class Entry
|
479
490
|
attr_reader :value
|
@@ -485,32 +496,24 @@ module Puppet::Environments
|
|
485
496
|
def touch
|
486
497
|
end
|
487
498
|
|
488
|
-
def expired?
|
499
|
+
def expired?(now)
|
489
500
|
false
|
490
501
|
end
|
491
502
|
|
492
503
|
def label
|
493
504
|
""
|
494
505
|
end
|
495
|
-
|
496
|
-
def expires
|
497
|
-
END_OF_TIME
|
498
|
-
end
|
499
506
|
end
|
500
507
|
|
501
508
|
# Always evicting entry
|
502
509
|
class NotCachedEntry < Entry
|
503
|
-
def expired?
|
510
|
+
def expired?(now)
|
504
511
|
true
|
505
512
|
end
|
506
513
|
|
507
514
|
def label
|
508
515
|
"(ttl = 0 sec)"
|
509
516
|
end
|
510
|
-
|
511
|
-
def expires
|
512
|
-
START_OF_TIME
|
513
|
-
end
|
514
517
|
end
|
515
518
|
|
516
519
|
# Policy that expires if it hasn't been touched within ttl_seconds
|
@@ -527,12 +530,8 @@ module Puppet::Environments
|
|
527
530
|
@ttl = Time.now + @ttl_seconds
|
528
531
|
end
|
529
532
|
|
530
|
-
def expired?
|
531
|
-
|
532
|
-
end
|
533
|
-
|
534
|
-
def expires
|
535
|
-
@ttl
|
533
|
+
def expired?(now)
|
534
|
+
now > @ttl
|
536
535
|
end
|
537
536
|
|
538
537
|
def label
|
data/lib/puppet/face/facts.rb
CHANGED
@@ -128,22 +128,46 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do
|
|
128
128
|
summary _("Show legacy facts when querying all facts.")
|
129
129
|
end
|
130
130
|
|
131
|
+
option("--value-only") do
|
132
|
+
summary _("Show only the value when the action is called with a single query")
|
133
|
+
end
|
134
|
+
|
135
|
+
option("--timing") do
|
136
|
+
summary _("Show how much time it took to resolve each fact.")
|
137
|
+
end
|
138
|
+
|
131
139
|
when_invoked do |*args|
|
132
140
|
options = args.pop
|
133
141
|
|
134
142
|
Puppet.settings.preferred_run_mode = :agent
|
135
143
|
Puppet::Node::Facts.indirection.terminus_class = :facter
|
136
144
|
|
145
|
+
if options[:value_only] && !args.count.eql?(1)
|
146
|
+
options[:value_only] = nil
|
147
|
+
Puppet.warning("Incorrect use of --value-only argument; it can only be used when querying for a single fact!")
|
148
|
+
end
|
137
149
|
|
138
150
|
options[:user_query] = args
|
139
151
|
options[:resolve_options] = true
|
140
152
|
result = Puppet::Node::Facts.indirection.find(Puppet.settings[:certname], options)
|
141
153
|
|
142
|
-
|
154
|
+
if options[:value_only]
|
155
|
+
result.values.values.first
|
156
|
+
else
|
157
|
+
result.values
|
158
|
+
end
|
143
159
|
end
|
144
160
|
|
145
161
|
when_rendering :console do |result|
|
146
|
-
|
162
|
+
# VALID_TYPES = [Integer, Float, TrueClass, FalseClass, NilClass, Symbol, String, Array, Hash].freeze
|
163
|
+
# from https://github.com/puppetlabs/facter/blob/4.0.49/lib/facter/custom_facts/util/normalization.rb#L8
|
164
|
+
|
165
|
+
case result
|
166
|
+
when Array, Hash
|
167
|
+
Puppet::Util::Json.dump(result, :pretty => true)
|
168
|
+
else # one of VALID_TYPES above
|
169
|
+
result
|
170
|
+
end
|
147
171
|
end
|
148
172
|
end
|
149
173
|
end
|
@@ -47,6 +47,14 @@ Puppet::Face.define(:node, '0.0.1') do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
class LoggerIO
|
50
|
+
def debug(message)
|
51
|
+
Puppet.debug(message)
|
52
|
+
end
|
53
|
+
|
54
|
+
def warn(message)
|
55
|
+
Puppet.warning(message)
|
56
|
+
end
|
57
|
+
|
50
58
|
def err(message)
|
51
59
|
Puppet.err(message) unless message =~ /^\s*Error:\s*/
|
52
60
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'puppet/ffi/posix'
|
2
|
+
|
3
|
+
module Puppet::FFI::POSIX
|
4
|
+
module Constants
|
5
|
+
extend FFI::Library
|
6
|
+
|
7
|
+
# Maximum number of supplementary groups (groups
|
8
|
+
# that a user can be in plus its primary group)
|
9
|
+
# (64 + 1 primary group)
|
10
|
+
# Chosen a reasonable middle number from the list
|
11
|
+
# https://www.j3e.de/ngroups.html
|
12
|
+
MAXIMUM_NUMBER_OF_GROUPS = 65
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'puppet/ffi/posix'
|
2
|
+
|
3
|
+
module Puppet::FFI::POSIX
|
4
|
+
module Functions
|
5
|
+
|
6
|
+
extend FFI::Library
|
7
|
+
|
8
|
+
ffi_convention :stdcall
|
9
|
+
|
10
|
+
# https://man7.org/linux/man-pages/man3/getgrouplist.3.html
|
11
|
+
# int getgrouplist (
|
12
|
+
# const char *user,
|
13
|
+
# gid_t group,
|
14
|
+
# gid_t *groups,
|
15
|
+
# int *ngroups
|
16
|
+
# );
|
17
|
+
begin
|
18
|
+
ffi_lib FFI::Library::LIBC
|
19
|
+
attach_function :getgrouplist, [:string, :uint, :pointer, :pointer], :int
|
20
|
+
rescue FFI::NotFoundError
|
21
|
+
# Do nothing
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -20,7 +20,7 @@ module Puppet::FFI::Windows
|
|
20
20
|
|
21
21
|
class ::FFI::Pointer
|
22
22
|
NULL_HANDLE = 0
|
23
|
-
WCHAR_NULL = "\0\0".
|
23
|
+
WCHAR_NULL = "\0\0".force_encoding('UTF-16LE').freeze
|
24
24
|
|
25
25
|
def self.from_string_to_wide_string(str, &block)
|
26
26
|
str = Puppet::Util::Windows::String.wide_string(str)
|
@@ -375,7 +375,7 @@ module Puppet::FFI::Windows
|
|
375
375
|
SERVICE_CONFIG_PRESHUTDOWN_INFO = 0x00000007
|
376
376
|
SERVICE_CONFIG_TRIGGER_INFO = 0x00000008
|
377
377
|
SERVICE_CONFIG_PREFERRED_NODE = 0x00000009
|
378
|
-
SERVICE_CONFIG_LAUNCH_PROTECTED =
|
378
|
+
SERVICE_CONFIG_LAUNCH_PROTECTED = 0x0000000C
|
379
379
|
SERVICE_NO_CHANGE = 0xffffffff
|
380
380
|
SERVICE_CONFIG_TYPES = {
|
381
381
|
SERVICE_CONFIG_DESCRIPTION => :SERVICE_CONFIG_DESCRIPTION,
|
@@ -33,8 +33,11 @@ class Puppet::FileServing::Configuration::Parser
|
|
33
33
|
when "path"
|
34
34
|
path(mount, value)
|
35
35
|
when "allow", "deny"
|
36
|
-
|
37
|
-
|
36
|
+
# ignore `allow *`, otherwise report error
|
37
|
+
if var != 'allow' || value != '*'
|
38
|
+
error_location_str = Puppet::Util::Errors.error_location(@file.filename, @count)
|
39
|
+
Puppet.err("Entry '#{line.chomp}' is unsupported and will be ignored at #{error_location_str}")
|
40
|
+
end
|
38
41
|
else
|
39
42
|
error_location_str = Puppet::Util::Errors.error_location(@file.filename, @count)
|
40
43
|
raise ArgumentError.new(_("Invalid argument '%{var}' at %{error_location}") %
|
@@ -7,6 +7,13 @@ class Puppet::FileSystem::MemoryFile
|
|
7
7
|
new(path, :exist? => false, :executable? => false)
|
8
8
|
end
|
9
9
|
|
10
|
+
def self.a_missing_directory(path)
|
11
|
+
new(path,
|
12
|
+
:exist? => false,
|
13
|
+
:executable? => false,
|
14
|
+
:directory? => true)
|
15
|
+
end
|
16
|
+
|
10
17
|
def self.a_regular_file_containing(path, content)
|
11
18
|
new(path, :exist? => true, :executable? => false, :content => content)
|
12
19
|
end
|
@@ -18,7 +25,7 @@ class Puppet::FileSystem::MemoryFile
|
|
18
25
|
def self.a_directory(path, children = [])
|
19
26
|
new(path,
|
20
27
|
:exist? => true,
|
21
|
-
:
|
28
|
+
:executable? => true,
|
22
29
|
:directory? => true,
|
23
30
|
:children => children)
|
24
31
|
end
|
@@ -128,6 +128,8 @@ class Puppet::FileSystem::Windows < Puppet::FileSystem::Posix
|
|
128
128
|
end
|
129
129
|
|
130
130
|
current_sid = Puppet::Util::Windows::SID.name_to_sid(Puppet::Util::Windows::ADSI::User.current_user_name)
|
131
|
+
current_sid = Puppet::Util::Windows::SID.name_to_sid(Puppet::Util::Windows::ADSI::User.current_sam_compatible_user_name) unless current_sid
|
132
|
+
|
131
133
|
dacl = case mode
|
132
134
|
when 0644
|
133
135
|
dacl = secure_dacl(current_sid)
|
data/lib/puppet/http/factory.rb
CHANGED
@@ -26,6 +26,10 @@ class Puppet::HTTP::Factory
|
|
26
26
|
|
27
27
|
http = Puppet::HTTP::Proxy.proxy(URI(site.addr))
|
28
28
|
http.use_ssl = site.use_ssl?
|
29
|
+
if site.use_ssl?
|
30
|
+
http.min_version = OpenSSL::SSL::TLS1_VERSION if http.respond_to?(:min_version)
|
31
|
+
http.ciphers = Puppet[:ciphers]
|
32
|
+
end
|
29
33
|
http.read_timeout = Puppet[:http_read_timeout]
|
30
34
|
http.open_timeout = Puppet[:http_connect_timeout]
|
31
35
|
http.keep_alive_timeout = KEEP_ALIVE_TIMEOUT if http.respond_to?(:keep_alive_timeout=)
|
@@ -103,6 +103,7 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
103
103
|
options_for_facter += " --show-legacy" if options[:show_legacy]
|
104
104
|
options_for_facter += " --no-block" if options[:no_block] == false
|
105
105
|
options_for_facter += " --no-cache" if options[:no_cache] == false
|
106
|
+
options_for_facter += " --timing" if options[:timing]
|
106
107
|
|
107
108
|
Puppet::Node::Facts.new(request.key, Facter.resolve(options_for_facter))
|
108
109
|
end
|
@@ -131,8 +131,54 @@ module Puppet::ModuleTool
|
|
131
131
|
begin
|
132
132
|
Puppet.info _("Resolving dependencies ...")
|
133
133
|
releases = SemanticPuppet::Dependency.resolve(graph)
|
134
|
-
rescue SemanticPuppet::Dependency::UnsatisfiableGraph
|
135
|
-
|
134
|
+
rescue SemanticPuppet::Dependency::UnsatisfiableGraph => e
|
135
|
+
unsatisfied = nil
|
136
|
+
|
137
|
+
if e.respond_to?(:unsatisfied)
|
138
|
+
constraints = {}
|
139
|
+
# If the module we're installing satisfies all its
|
140
|
+
# dependencies, but would break an already installed
|
141
|
+
# module that depends on it, show what would break.
|
142
|
+
if name == e.unsatisfied
|
143
|
+
graph.constraints[name].each do |mod, range, _|
|
144
|
+
next unless mod.split.include?('constraint')
|
145
|
+
|
146
|
+
# If the user requested a specific version or range,
|
147
|
+
# only show the modules with non-intersecting ranges
|
148
|
+
if options[:version]
|
149
|
+
requested_range = SemanticPuppet::VersionRange.parse(options[:version])
|
150
|
+
constraint_range = SemanticPuppet::VersionRange.parse(range)
|
151
|
+
|
152
|
+
if requested_range.intersection(constraint_range) == SemanticPuppet::VersionRange::EMPTY_RANGE
|
153
|
+
constraints[mod.split.first] = range
|
154
|
+
end
|
155
|
+
else
|
156
|
+
constraints[mod.split.first] = range
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
# If the module fails to satisfy one of its
|
161
|
+
# dependencies, show the unsatisfiable module
|
162
|
+
else
|
163
|
+
unsatisfied_range = graph.dependencies[name].max.constraints[e.unsatisfied].first[1]
|
164
|
+
constraints[e.unsatisfied] = unsatisfied_range
|
165
|
+
end
|
166
|
+
|
167
|
+
installed_module = @environment.module_by_forge_name(e.unsatisfied.tr('-', '/'))
|
168
|
+
current_version = installed_module.version if installed_module
|
169
|
+
|
170
|
+
unsatisfied = {
|
171
|
+
:name => e.unsatisfied,
|
172
|
+
:constraints => constraints,
|
173
|
+
:current_version => current_version
|
174
|
+
}
|
175
|
+
end
|
176
|
+
|
177
|
+
raise NoVersionsSatisfyError, results.merge(
|
178
|
+
:requested_name => name,
|
179
|
+
:requested_version => options[:version] || graph.dependencies[name].max.version.to_s,
|
180
|
+
:unsatisfied => unsatisfied
|
181
|
+
)
|
136
182
|
end
|
137
183
|
|
138
184
|
unless forced?
|