mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +01:00
Handle deleting symlinks differently on Windows
This commit is contained in:
parent
64631d276b
commit
af89b273e6
@ -7,7 +7,11 @@ import java.nio.file.Files;
|
|||||||
public class stdapi_fs_delete_dir_V1_7 extends stdapi_fs_delete_dir {
|
public class stdapi_fs_delete_dir_V1_7 extends stdapi_fs_delete_dir {
|
||||||
@Override
|
@Override
|
||||||
protected boolean deleteSymlink(File file) throws IOException {
|
protected boolean deleteSymlink(File file) throws IOException {
|
||||||
Files.delete(file.toPath());
|
String osName = System.getProperty("os.name");
|
||||||
return true;
|
if (osName != null && osName.toLowerCase().contains("windows")) {
|
||||||
|
Files.delete(file.toPath());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return file.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user