mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-08 14:36:22 +01:00
parent
1c32b76286
commit
405d55f8c9
@ -296,7 +296,7 @@ DWORD request_fs_chdir(Remote *remote, Packet *packet)
|
||||
#ifdef _WIN32
|
||||
else if (!SetCurrentDirectory(directory))
|
||||
#else
|
||||
else if (!chdir(directory))
|
||||
else if (chdir(directory))
|
||||
#endif
|
||||
result = GetLastError();
|
||||
|
||||
@ -327,7 +327,7 @@ DWORD request_fs_mkdir(Remote *remote, Packet *packet)
|
||||
#ifdef _WIN32
|
||||
else if (!CreateDirectory(directory, NULL))
|
||||
#else
|
||||
else if (!mkdir(directory, 0777))
|
||||
else if (mkdir(directory, 0777))
|
||||
#endif
|
||||
result = GetLastError();
|
||||
|
||||
@ -358,7 +358,7 @@ DWORD request_fs_delete_dir(Remote *remote, Packet *packet)
|
||||
#ifdef _WIN32
|
||||
else if (!RemoveDirectory(directory))
|
||||
#else
|
||||
else if (!rmdir(directory))
|
||||
else if (rmdir(directory))
|
||||
#endif
|
||||
result = GetLastError();
|
||||
|
||||
|
@ -175,11 +175,7 @@ DWORD request_fs_file_channel_open(Remote *remote, Packet *packet)
|
||||
// Invalid file?
|
||||
if (!(ctx->fd = fopen(expandedFilePath, mode)))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
res = GetLastError();
|
||||
#else
|
||||
res = errno;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@ -312,7 +308,7 @@ DWORD request_fs_delete_file(Remote *remote, Packet *packet)
|
||||
#ifdef _WIN32
|
||||
else if (!DeleteFile(path))
|
||||
#else
|
||||
else if (!unlink(path))
|
||||
else if (unlink(path))
|
||||
#endif
|
||||
result = GetLastError();
|
||||
|
||||
@ -510,7 +506,7 @@ DWORD request_fs_file_move(Remote *remote, Packet *packet)
|
||||
#ifdef _WIN32
|
||||
else if (!MoveFile(oldpath,newpath))
|
||||
#else
|
||||
else if (!rename(oldpath,newpath))
|
||||
else if (rename(oldpath,newpath))
|
||||
#endif
|
||||
result = GetLastError();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user