Class Chef::ScanAccessControl
In: lib/chef/scan_access_control.rb
Parent: Object

ScanAccessControl

Reads Access Control Settings on a file and writes them out to a resource (should be the current_resource), attempting to match the style used by the new resource, that is, if users are specified with usernames in new_resource, then the uids from stat will be looked up and usernames will be added to current_resource.

Why?

FileAccessControl objects may operate on a temporary file, in which case we won‘t know if the access control settings changed (ex: rendering a template with both a change in content and ownership). For auditing purposes, we need to record the current state of a file system entity.

Methods

Attributes

current_resource  [R] 
new_resource  [R] 

Public Class methods

Public Instance methods

Modifies @current_resource, setting the current access control state.

Set the group attribute of current_resource to whatever the current state is.

Set the owner attribute of current_resource to whatever the current state is. Attempts to match the format given in new_resource: if the new_resource specifies the owner as a string, the username for the uid will be looked up and owner will be set to the username, and vice versa.

[Validate]