@@ -53,8 +53,8 @@ def run
53
53
last = execute ( "/usr/bin/last && /usr/bin/lastlog" )
54
54
sudoers = cat_file ( "/etc/sudoers" )
55
55
56
- save ( "Last logs" , last ) unless last . nil ?
57
- save ( "Sudoers" , sudoers ) unless sudoers . nil ? || sudoers =~ /Permission denied/
56
+ save ( "Last logs" , last ) unless last . blank ?
57
+ save ( "Sudoers" , sudoers ) unless sudoers . blank ? || sudoers =~ /Permission denied/
58
58
end
59
59
60
60
def save ( msg , data , ctype = "text/plain" )
@@ -121,13 +121,13 @@ def get_mysql_history(users, user)
121
121
vprint_status ( "Extracting MySQL history for #{ u } " )
122
122
sql_hist = cat_file ( "/home/#{ u } /.mysql_history" )
123
123
end
124
- save ( "MySQL History for #{ u } " , sql_hist ) unless sql_hist . nil ? || sql_hist =~ /No such file or directory/
124
+ save ( "MySQL History for #{ u } " , sql_hist ) unless sql_hist . blank ? || sql_hist =~ /No such file or directory/
125
125
end
126
126
else
127
127
vprint_status ( "Extracting MySQL history for #{ user } " )
128
128
sql_hist = cat_file ( "/home/#{ user } /.mysql_history" )
129
129
vprint_status ( sql_hist ) if sql_hist
130
- save ( "MySQL History for #{ user } " , sql_hist ) unless sql_hist . nil ? || sql_hist =~ /No such file or directory/
130
+ save ( "MySQL History for #{ user } " , sql_hist ) unless sql_hist . blank ? || sql_hist =~ /No such file or directory/
131
131
end
132
132
end
133
133
@@ -164,13 +164,13 @@ def get_vim_history(users, user)
164
164
vim_hist = cat_file ( "/home/#{ u } /.viminfo" )
165
165
end
166
166
167
- save ( "VIM History for #{ u } " , vim_hist ) unless vim_hist . nil ? || vim_hist =~ /No such file or directory/
167
+ save ( "VIM History for #{ u } " , vim_hist ) unless vim_hist . blank ? || vim_hist =~ /No such file or directory/
168
168
end
169
169
else
170
170
vprint_status ( "Extracting history for #{ user } " )
171
171
vim_hist = cat_file ( "/home/#{ user } /.viminfo" )
172
172
vprint_status ( vim_hist )
173
- save ( "VIM History for #{ user } " , vim_hist ) unless vim_hist . nil ? || vim_hist =~ /No such file or directory/
173
+ save ( "VIM History for #{ user } " , vim_hist ) unless vim_hist . blank ? || vim_hist =~ /No such file or directory/
174
174
end
175
175
end
176
176
end
0 commit comments