1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-14 17:37:27 +01:00

Land #516, fix python stat on inaccessible directory

This commit is contained in:
Tim W 2021-12-09 17:47:30 +00:00
commit 080af01e83
No known key found for this signature in database
GPG Key ID: 217FBA50ABBAABEF

View File

@ -1494,7 +1494,11 @@ def stdapi_fs_ls(request, response):
file_path = os.path.join(path, file_name)
response += tlv_pack(TLV_TYPE_FILE_NAME, file_name)
response += tlv_pack(TLV_TYPE_FILE_PATH, file_path)
response += tlv_pack(TLV_TYPE_STAT_BUF, get_stat_buffer(file_path))
try:
st_buf = get_stat_buffer(file_path)
except OSError:
st_buf = bytes()
response += tlv_pack(TLV_TYPE_STAT_BUF, st_buf)
return ERROR_SUCCESS, response
@register_function