Skip to content

[Bug]: syslog gem presence is used to determine POSIX #90

Open
@ekohl

Description

@ekohl

Is this a critical security issue?

  • This is not a security issue.

Describe the Bug

Puppet uses syslog to determine POSIX and Ruby 3.4 no longer ships syslog by default.

$ bundle exec puppet --help
/home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet/util/feature.rb:116: warning: syslog was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
You can add syslog to your Gemfile or gemspec to silence this warning.
bundler: failed to load command: puppet (/home/ekohl/.local/share/gem/ruby/bin/puppet)
/home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet/feature/base.rb:21:in '<top (required)>': Cannot determine basic system flavour (Puppet::Error)
	from /home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet.rb:91:in 'Kernel#require_relative'
	from /home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet.rb:91:in '<module:Puppet>'
	from /home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet.rb:38:in '<top (required)>'
	from /home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet/util/command_line.rb:14:in 'Kernel#require_relative'
	from /home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/lib/puppet/util/command_line.rb:14:in '<top (required)>'
	from /usr/share/ruby/bundled_gems.rb:82:in 'Kernel.require'
	from /usr/share/ruby/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /home/ekohl/.local/share/gem/ruby/gems/openvox-8.19.0/bin/puppet:5:in '<top (required)>'
	from /home/ekohl/.local/share/gem/ruby/bin/puppet:25:in 'Kernel#load'
	from /home/ekohl/.local/share/gem/ruby/bin/puppet:25:in '<top (required)>'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/cli/exec.rb:59:in 'Kernel.load'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/cli/exec.rb:59:in 'Bundler::CLI::Exec#kernel_load'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/cli.rb:452:in 'Bundler::CLI#exec'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/vendor/thor/lib/thor.rb:538:in 'Bundler::Thor.dispatch'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/cli.rb:29:in 'Bundler::CLI.start'
	from /usr/share/gems/gems/bundler-2.6.2/exe/bundle:28:in 'block in <top (required)>'
	from /usr/share/gems/gems/bundler-2.6.2/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
	from /usr/share/gems/gems/bundler-2.6.2/exe/bundle:20:in '<top (required)>'
	from /home/ekohl/bin/bundle:25:in 'Kernel#load'
	from /home/ekohl/bin/bundle:25:in '<main>'

Expected Behavior

Puppet help shows

Steps to Reproduce

mkdir reproducer
cd reproducer
bundle init
bundle add openvox
bundle add racc # https://github.com/OpenVoxProject/puppet/pull/89
bundle exec puppet --help

Environment

Ruby 3.4

Additional Context

Relevant code:

# We have a syslog implementation
Puppet.features.add(:syslog, :libs => ["syslog"])
# We can use POSIX user functions
Puppet.features.add(:posix) do
require 'etc'
!Etc.getpwuid(0).nil? && Puppet.features.syslog?
end
# We can use Microsoft Windows functions
Puppet.features.add(:microsoft_windows) { Puppet::Util::Platform.windows? }
raise Puppet::Error, _("Cannot determine basic system flavour") unless Puppet.features.posix? or Puppet.features.microsoft_windows?

And Ruby 3.4 made syslog a bundled gem instead of a default gem. This means you need to specify it in your gemspec or every consumer needs to specify it in their Gemfile. See https://stdgems.org/syslog/

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions