MCPcopy
hub / github.com/fortra/impacket / queryPathInformation

Method queryPathInformation

impacket/smbserver.py:902–929  ·  view source on GitHub ↗
(connId, smbServer, recvPacket, parameters, data, maxDataCount=0)

Source from the content-addressed store, hash-verified

900
901 @staticmethod
902 def queryPathInformation(connId, smbServer, recvPacket, parameters, data, maxDataCount=0):
903 connData = smbServer.getConnectionData(connId)
904
905 respSetup = b''
906 respParameters = b''
907 respData = b''
908 errorCode = 0
909
910 queryPathInfoParameters = smb.SMBQueryPathInformation_Parameters(flags=recvPacket['Flags2'], data=parameters)
911
912 if recvPacket['Tid'] in connData['ConnectedShares']:
913 path = connData['ConnectedShares'][recvPacket['Tid']]['path']
914 try:
915 infoRecord, errorCode = queryPathInformation(path, decodeSMBString(recvPacket['Flags2'],
916 queryPathInfoParameters['FileName']),
917 queryPathInfoParameters['InformationLevel'])
918 except Exception as e:
919 smbServer.log("queryPathInformation: %s" % e, logging.ERROR, connData=connData)
920
921 if infoRecord is not None:
922 respParameters = smb.SMBQueryPathInformationResponse_Parameters()
923 respData = infoRecord
924 else:
925 errorCode = STATUS_SMB_BAD_TID
926
927 smbServer.setConnectionData(connId, connData)
928
929 return respSetup, respParameters, respData, errorCode
930
931 @staticmethod
932 def queryFsInformation(connId, smbServer, recvPacket, parameters, data, maxDataCount=0):

Callers

nothing calls this directly

Calls 5

queryPathInformationFunction · 0.85
decodeSMBStringFunction · 0.85
getConnectionDataMethod · 0.80
setConnectionDataMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected