(self, pkt)
| 1401 | |
| 1402 | @ATMT.action(receive_query_info) |
| 1403 | def send_query_info_response(self, pkt): |
| 1404 | self.update_smbheader(pkt) |
| 1405 | # [MS-FSCC] + [MS-SMB2] sect 2.2.37 / 3.3.5.20.1 |
| 1406 | fid = self.get_file_id(pkt) |
| 1407 | if pkt.InfoType == 0x01: # SMB2_0_INFO_FILE |
| 1408 | if pkt.FileInfoClass == 0x05: # FileStandardInformation |
| 1409 | attrs = self.current_handles[fid][1] |
| 1410 | fileinfo = FileStandardInformation( |
| 1411 | EndOfFile=attrs["EndOfFile"], |
| 1412 | AllocationSize=attrs["AllocationSize"], |
| 1413 | ) |
| 1414 | elif pkt.FileInfoClass == 0x06: # FileInternalInformation |
| 1415 | pth = self.current_handles[fid][0] |
| 1416 | fileinfo = FileInternalInformation( |
| 1417 | IndexNumber=hash(pth) & 0xFFFFFFFFFFFFFFFF, |
| 1418 | ) |
| 1419 | elif pkt.FileInfoClass == 0x07: # FileEaInformation |
| 1420 | fileinfo = FileEaInformation() |
| 1421 | elif pkt.FileInfoClass == 0x12: # FileAllInformation |
| 1422 | attrs = self.current_handles[fid][1] |
| 1423 | fileinfo = FileAllInformation( |
| 1424 | BasicInformation=FileBasicInformation( |
| 1425 | CreationTime=attrs["CreationTime"], |
| 1426 | LastAccessTime=attrs["LastAccessTime"], |
| 1427 | LastWriteTime=attrs["LastWriteTime"], |
| 1428 | ChangeTime=attrs["ChangeTime"], |
| 1429 | FileAttributes=attrs["FileAttributes"], |
| 1430 | ), |
| 1431 | StandardInformation=FileStandardInformation( |
| 1432 | EndOfFile=attrs["EndOfFile"], |
| 1433 | AllocationSize=attrs["AllocationSize"], |
| 1434 | ), |
| 1435 | ) |
| 1436 | elif pkt.FileInfoClass == 0x15: # FileAlternateNameInformation |
| 1437 | pth = self.current_handles[fid][0] |
| 1438 | fileinfo = FileAlternateNameInformation( |
| 1439 | FileName=pth.name, |
| 1440 | ) |
| 1441 | elif pkt.FileInfoClass == 0x16: # FileStreamInformation |
| 1442 | attrs = self.current_handles[fid][1] |
| 1443 | fileinfo = FileStreamInformation( |
| 1444 | StreamSize=attrs["EndOfFile"], |
| 1445 | StreamAllocationSize=attrs["AllocationSize"], |
| 1446 | ) |
| 1447 | elif pkt.FileInfoClass == 0x22: # FileNetworkOpenInformation |
| 1448 | attrs = self.current_handles[fid][1] |
| 1449 | fileinfo = FileNetworkOpenInformation( |
| 1450 | **attrs, |
| 1451 | ) |
| 1452 | elif pkt.FileInfoClass == 0x30: # FileNormalizedNameInformation |
| 1453 | pth = self.current_handles[fid][0] |
| 1454 | fileinfo = FILE_NAME_INFORMATION( |
| 1455 | FileName=pth.name, |
| 1456 | ) |
| 1457 | else: |
| 1458 | log_runtime.warning( |
| 1459 | "Unimplemented: %s" |
| 1460 | % pkt[SMB2_Query_Info_Request].sprintf("%InfoType% %FileInfoClass%") |
nothing calls this directly
no test coverage detected