Skip to content

Commit 8324247

Browse files
authored
Merge pull request #8929 from thebeanogamer/fix/main/pup11603
(PUP-110603) Mark ZFS as an SELinux-Capable Filesystem
2 parents b8ff04c + 938f54b commit 8324247

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/puppet/util/selinux.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def selinux_category_to_label(category)
204204
def selinux_label_support?(file)
205205
fstype = find_fs(file)
206206
return false if fstype.nil?
207-
filesystems = ['ext2', 'ext3', 'ext4', 'gfs', 'gfs2', 'xfs', 'jfs', 'btrfs', 'tmpfs']
207+
filesystems = ['ext2', 'ext3', 'ext4', 'gfs', 'gfs2', 'xfs', 'jfs', 'btrfs', 'tmpfs', 'zfs']
208208
filesystems.include?(fstype)
209209
end
210210

spec/unit/util/selinux_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
'/' => 'ext3',
6666
'/sys' => 'sysfs',
6767
'/mnt/nfs' => 'nfs',
68+
'/mnt/zfs' => 'zfs',
6869
'/proc' => 'proc',
6970
'/dev' => 'tmpfs' })
7071
end
@@ -85,6 +86,10 @@
8586
expect(selinux_label_support?('/dev/shm/testfile')).to be_truthy
8687
end
8788

89+
it "should return true if zfs" do
90+
expect(selinux_label_support?('/mnt/zfs/testfile')).to be_truthy
91+
end
92+
8893
it "should return false for a noncapable filesystem" do
8994
expect(selinux_label_support?('/mnt/nfs/testfile')).to be_falsey
9095
end

0 commit comments

Comments
 (0)