Skip to content

Commit 8a49a63

Browse files
committed
check file exists before reading
1 parent e8eeb78 commit 8a49a63

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/post/linux/gather/mount_cifs_creds.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def run
3838
])
3939

4040
# parse each line from /etc/fstab
41+
fail_with(Failure::NotFound, '/etc/fstab not found on system') unless file_exist?('/etc/fstab')
4142
read_file("/etc/fstab").each_line do |fstab_line|
4243
fstab_line.strip!
4344
# where we'll store the current parsed credentials, if any

0 commit comments

Comments
 (0)