Class: RubySMB::SMB2::Packet::TreeConnectResponse
- Inherits:
-
GenericPacket
- Object
- BinData::Record
- GenericPacket
- RubySMB::SMB2::Packet::TreeConnectResponse
- Defined in:
- lib/ruby_smb/smb2/packet/tree_connect_response.rb
Overview
An SMB2 TreeConnectResponse Packet as defined in 2.2.10 SMB2 TREE_CONNECT Response
Constant Summary collapse
- COMMAND =
RubySMB::SMB2::Commands::TREE_CONNECT
Instance Method Summary collapse
-
#access_rights ⇒ RubySMB::SMB2::BitField::DirectoryAccessMask, RubySMB::SMB2::BitField::FileAccessMask
Returns the ACCESS_MASK for the Maximal Share Access Rights.
- #initialize_instance ⇒ Object
-
#is_directory? ⇒ Boolean
Checks if the remote Tree is a directory.
Methods inherited from GenericPacket
describe, #display, fields_hashed, format_field, #packet_smb_version, read, #status_code, #valid?, walk_fields
Instance Method Details
#access_rights ⇒ RubySMB::SMB2::BitField::DirectoryAccessMask, RubySMB::SMB2::BitField::FileAccessMask
Returns the ACCESS_MASK for the Maximal Share Access Rights. The packet defaults this to a BitField::DirectoryAccessMask. If it is anything other than a directory that has been connected to, it will re-cast it as a BitField::FileAccessMask
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ruby_smb/smb2/packet/tree_connect_response.rb', line 30 def access_rights if is_directory? maximal_access else mask = maximal_access.to_binary_s begin RubySMB::SMB2::BitField::FileAccessMask.read(mask) rescue IOError raise RubySMB::Error::InvalidBitField, 'Invalid ACCESS_MASK for the Maximal Share Access Rights' end end end |
#initialize_instance ⇒ Object
18 19 20 21 |
# File 'lib/ruby_smb/smb2/packet/tree_connect_response.rb', line 18 def initialize_instance super smb2_header.flags.reply = 1 end |
#is_directory? ⇒ Boolean
Checks if the remote Tree is a directory
46 47 48 |
# File 'lib/ruby_smb/smb2/packet/tree_connect_response.rb', line 46 def is_directory? share_type == 0x01 end |