From 8fa65756039637cc558c2a50cffb728cfcbe703d Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Thu, 30 Aug 2012 17:34:22 -0700 Subject: [PATCH] Make SELinux internal helper functions private. There are a handful of internal helper functions in the SELinux utility code, dealing with finding the filesystem that a file resides on. We may as well make them private in the code. Signed-off-by: Daniel Pittman --- lib/puppet/util/selinux.rb | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index 17c631b904d..70165af33fa 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -136,6 +136,21 @@ def set_selinux_default_context(file) nil end + ######################################################################## + # Internal helper methods from here on in, kids. Don't fiddle. + private + + # Check filesystem a path resides on for SELinux support against + # whitelist of known-good filesystems. + # Returns true if the filesystem can support SELinux labels and + # false if not. + def selinux_label_support?(file) + fstype = find_fs(file) + return false if fstype.nil? + filesystems = ['ext2', 'ext3', 'ext4', 'gfs', 'gfs2', 'xfs', 'jfs'] + filesystems.include?(fstype) + end + # Internal helper function to read and parse /proc/mounts def read_mounts mounts = "" @@ -201,16 +216,4 @@ def find_fs(path) end mnts['/'] end - - # Check filesystem a path resides on for SELinux support against - # whitelist of known-good filesystems. - # Returns true if the filesystem can support SELinux labels and - # false if not. - def selinux_label_support?(file) - fstype = find_fs(file) - return false if fstype.nil? - filesystems = ['ext2', 'ext3', 'ext4', 'gfs', 'gfs2', 'xfs', 'jfs'] - filesystems.include?(fstype) - end - end