Skip to content

Commit 5ec3d5f

Browse files
committed
Raise specific exceptions
1 parent 450716c commit 5ec3d5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/post/osx/gather/autologin_password.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def initialize(info={})
3838
def run
3939
# ensure the user is root (or can read the kcpassword)
4040
if not user == 'root'
41-
fail_with "Root privileges are required to read kcpassword file"
41+
fail_with(Failure::NoAccess, "Root privileges are required to read kcpassword file")
4242
end
4343

4444
# read the autologin account from prefs plist
@@ -48,7 +48,7 @@ def run
4848
if autouser.present?
4949
print_status "User #{autouser} has autologin enabled, decoding password..."
5050
else
51-
fail_with "No users on this machine have autologin enabled"
51+
fail_with(Failure::NotVulnerable, "No users on this machine have autologin enabled")
5252
end
5353

5454
# kcpass contains the XOR'd bytes

0 commit comments

Comments
 (0)