This file is indexed.

/usr/lib/ruby/vendor_ruby/chef_compat/resource.rb is in ruby-compat-resource 12.10.5-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'chef_compat/monkeypatches'
require 'chef_compat/copied_from_chef/chef/resource'

# We do NOT want action defined if chefspec is engaged
if Chef::Provider::InlineResources::ClassMethods.instance_method(:action).source_location[0] =~ /chefspec/
  ChefCompat::CopiedFromChef::Chef::Provider::InlineResources::ClassMethods.instance_eval do
    remove_method(:action)
  end
end

module ChefCompat
  class Resource < ChefCompat::CopiedFromChef::Chef::Resource
    def initialize(*args, &block)
      super
      # @resource_name is used in earlier Chef versions
      @resource_name = self.class.resource_name
    end
    # Things we'll need to define ourselves:
    # 1. provider
    # 2. resource_name

    def provider(*args, &block)
      super || self.class.action_class
    end
    def provider=(arg)
      provider(arg)
    end

    if !respond_to?(:resource_name)
      def self.resource_name(name=Chef::NOT_PASSED)
        # Setter
        if name != Chef::NOT_PASSED
  #        remove_canonical_dsl

          # Set the resource_name and call provides
          if name
            name = name.to_sym
            # If our class is not already providing this name, provide it.
            # Commented out: use of resource_name and provides will need to be
            # mutually exclusive in this world, generally.
            # if !Chef::ResourceResolver.includes_handler?(name, self)
              provides name#, canonical: true
            # end
            @resource_name = name
          else
            @resource_name = nil
          end
        end
        @resource_name
      end
      def self.resource_name=(name)
        resource_name(name)
      end
    end
  end
end