File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
modules/auxiliary/admin/smb Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,11 @@ def get_output(file)
136
136
137
137
# check if our process is done using these files
138
138
def exclusive_access ( *files )
139
+ begin
139
140
simple . connect ( "\\ \\ #{ @ip } \\ #{ @smbshare } " )
141
+ rescue
142
+ return false
143
+ end
140
144
files . each do |file |
141
145
begin
142
146
print_status ( "checking if the file is unlocked" )
@@ -154,7 +158,12 @@ def exclusive_access(*files)
154
158
155
159
# Removes files created during execution.
156
160
def cleanup_after ( *files )
157
- simple . connect ( "\\ \\ #{ @ip } \\ #{ @smbshare } " )
161
+ begin
162
+ simple . connect ( "\\ \\ #{ @ip } \\ #{ @smbshare } " )
163
+ rescue
164
+ print_error ( "Unable to connect for cleanup. Maybe you'll need to manually remove #{ left . join ( ", " ) } from the target." )
165
+ return
166
+ end
158
167
print_status ( "Executing cleanup..." )
159
168
files . each do |file |
160
169
begin
You can’t perform that action at this time.
0 commit comments