ruby_smb 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/examples/tree_connect.rb +27 -0
- data/lib/ruby_smb/client.rb +25 -2
- data/lib/ruby_smb/client/authentication.rb +5 -6
- data/lib/ruby_smb/client/negotiation.rb +2 -3
- data/lib/ruby_smb/client/signing.rb +6 -2
- data/lib/ruby_smb/client/tree_connect.rb +86 -0
- data/lib/ruby_smb/generic_packet.rb +1 -1
- data/lib/ruby_smb/smb1.rb +1 -1
- data/lib/ruby_smb/smb1/bit_field.rb +4 -0
- data/lib/ruby_smb/smb1/bit_field/directory_access_mask.rb +38 -0
- data/lib/ruby_smb/smb1/bit_field/file_access_mask.rb +38 -0
- data/lib/ruby_smb/smb1/bit_field/optional_support.rb +19 -0
- data/lib/ruby_smb/smb1/bit_field/tree_connect_flags.rb +18 -0
- data/lib/ruby_smb/smb1/commands.rb +2 -0
- data/lib/ruby_smb/smb1/packet.rb +4 -0
- data/lib/ruby_smb/smb1/packet/tree_connect_request.rb +34 -0
- data/lib/ruby_smb/smb1/packet/tree_connect_response.rb +74 -0
- data/lib/ruby_smb/smb1/packet/tree_disconnect_request.rb +29 -0
- data/lib/ruby_smb/smb1/packet/tree_disconnect_response.rb +30 -0
- data/lib/ruby_smb/smb1/tree.rb +55 -0
- data/lib/ruby_smb/smb2.rb +1 -0
- data/lib/ruby_smb/smb2/bit_field.rb +4 -0
- data/lib/ruby_smb/smb2/bit_field/directory_access_mask.rb +38 -0
- data/lib/ruby_smb/smb2/bit_field/file_access_mask.rb +38 -0
- data/lib/ruby_smb/smb2/bit_field/share_capabailities.rb +21 -0
- data/lib/ruby_smb/smb2/bit_field/share_flags.rb +75 -0
- data/lib/ruby_smb/smb2/packet.rb +5 -0
- data/lib/ruby_smb/smb2/packet/error_packet.rb +15 -0
- data/lib/ruby_smb/smb2/packet/tree_connect_request.rb +27 -0
- data/lib/ruby_smb/smb2/packet/tree_connect_response.rb +50 -0
- data/lib/ruby_smb/smb2/packet/tree_disconnect_request.rb +21 -0
- data/lib/ruby_smb/smb2/packet/tree_disconnect_response.rb +22 -0
- data/lib/ruby_smb/smb2/smb2_header.rb +3 -3
- data/lib/ruby_smb/smb2/tree.rb +51 -0
- data/lib/ruby_smb/version.rb +1 -1
- data/ruby_smb.gemspec +1 -1
- data/spec/lib/ruby_smb/client_spec.rb +114 -4
- data/spec/lib/ruby_smb/smb1/bit_field/directory_access_mask_spec.rb +190 -0
- data/spec/lib/ruby_smb/smb1/bit_field/file_access_mask_spec.rb +190 -0
- data/spec/lib/ruby_smb/smb1/bit_field/optional_support_spec.rb +52 -0
- data/spec/lib/ruby_smb/smb1/bit_field/tree_connect_flags_spec.rb +37 -0
- data/spec/lib/ruby_smb/smb1/packet/tree_connect_request_spec.rb +53 -0
- data/spec/lib/ruby_smb/smb1/packet/tree_connect_response_spec.rb +86 -0
- data/spec/lib/ruby_smb/smb1/packet/tree_disconnect_request_spec.rb +40 -0
- data/spec/lib/ruby_smb/smb1/packet/tree_disconnect_response_spec.rb +40 -0
- data/spec/lib/ruby_smb/smb1/tree_spec.rb +55 -0
- data/spec/lib/ruby_smb/smb2/bit_field/directory_access_mask_spec.rb +190 -0
- data/spec/lib/ruby_smb/smb2/bit_field/file_access_mask_spec.rb +190 -0
- data/spec/lib/ruby_smb/smb2/bit_field/share_capabilities_spec.rb +54 -0
- data/spec/lib/ruby_smb/smb2/bit_field/share_flags_spec.rb +184 -0
- data/spec/lib/ruby_smb/smb2/packet/tree_connect_request_spec.rb +49 -0
- data/spec/lib/ruby_smb/smb2/packet/tree_connect_response_spec.rb +57 -0
- data/spec/lib/ruby_smb/smb2/packet/tree_disconnect_request_spec.rb +30 -0
- data/spec/lib/ruby_smb/smb2/packet/tree_disconnect_response_spec.rb +30 -0
- data/spec/lib/ruby_smb/smb2/tree_spec.rb +54 -0
- metadata +63 -6
- metadata.gz.sig +0 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RubySMB::SMB1::Packet::TreeDisconnectResponse do
|
4
|
+
|
5
|
+
subject(:packet) { described_class.new }
|
6
|
+
|
7
|
+
describe '#smb_header' do
|
8
|
+
subject(:header) { packet.smb_header }
|
9
|
+
|
10
|
+
it 'is a standard SMB Header' do
|
11
|
+
expect(header).to be_a RubySMB::SMB1::SMBHeader
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should have the command set to SMB_COM_NEGOTIATE' do
|
15
|
+
expect(header.command).to eq RubySMB::SMB1::Commands::SMB_COM_TREE_DISCONNECT
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should not have the response flag set' do
|
19
|
+
expect(header.flags.reply).to eq 1
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#parameter_block' do
|
24
|
+
subject(:parameter_block) { packet.parameter_block }
|
25
|
+
|
26
|
+
it 'is a standard ParameterBlock' do
|
27
|
+
expect(parameter_block).to be_a RubySMB::SMB1::ParameterBlock
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#data_block' do
|
32
|
+
subject(:data_block) { packet.data_block }
|
33
|
+
|
34
|
+
it 'is a standard DataBlock' do
|
35
|
+
expect(data_block).to be_a RubySMB::SMB1::DataBlock
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe RubySMB::SMB1::Tree do
|
4
|
+
let(:dispatcher) { RubySMB::Dispatcher::Socket.new(nil) }
|
5
|
+
|
6
|
+
let(:client) { RubySMB::Client.new(dispatcher, username: 'msfadmin', password: 'msfadmin') }
|
7
|
+
let(:tree_id) { 2049 }
|
8
|
+
let(:path) { '\\192.168.1.1\example' }
|
9
|
+
let(:response) {
|
10
|
+
packet = RubySMB::SMB1::Packet::TreeConnectResponse.new
|
11
|
+
packet.smb_header.tid = tree_id
|
12
|
+
packet.parameter_block.access_rights.read("\xff\x01\x1f\x00")
|
13
|
+
packet.data_block.service = 'A:'
|
14
|
+
packet
|
15
|
+
}
|
16
|
+
subject(:tree) {
|
17
|
+
described_class.new(client:client, share:path, response:response )
|
18
|
+
}
|
19
|
+
|
20
|
+
it { is_expected.to respond_to :client }
|
21
|
+
it { is_expected.to respond_to :guest_permissions }
|
22
|
+
it { is_expected.to respond_to :permissions }
|
23
|
+
it { is_expected.to respond_to :share }
|
24
|
+
it { is_expected.to respond_to :id }
|
25
|
+
|
26
|
+
it 'inherits the client that spawned it' do
|
27
|
+
expect(tree.client).to eq client
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'inherits the permissions from the response packet' do
|
31
|
+
expect(tree.permissions).to eq response.parameter_block.access_rights
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'inherits the Tree id from the response packet' do
|
35
|
+
expect(tree.id).to eq response.smb_header.tid
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#disconnect!' do
|
39
|
+
let(:disco_req) { RubySMB::SMB1::Packet::TreeDisconnectRequest.new }
|
40
|
+
let(:disco_resp) { RubySMB::SMB1::Packet::TreeDisconnectResponse.new }
|
41
|
+
|
42
|
+
it 'sends a TreeDisconnectRequest with the Tree ID in the header' do
|
43
|
+
allow(RubySMB::SMB1::Packet::TreeDisconnectRequest).to receive(:new).and_return(disco_req)
|
44
|
+
modified_req = disco_req
|
45
|
+
modified_req.smb_header.tid = tree.id
|
46
|
+
expect(client).to receive(:send_recv).with(modified_req).and_return(disco_resp.to_binary_s)
|
47
|
+
tree.disconnect!
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'returns the NTStatus code from the response' do
|
51
|
+
allow(client).to receive(:send_recv).and_return(disco_resp.to_binary_s)
|
52
|
+
expect(tree.disconnect!).to eq disco_resp.status_code
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,190 @@
|
|
1
|
+
RSpec.describe RubySMB::SMB2::BitField::DirectoryAccessMask do
|
2
|
+
subject(:flags) { described_class.new }
|
3
|
+
|
4
|
+
it { is_expected.to respond_to :read_attr }
|
5
|
+
it { is_expected.to respond_to :delete_child }
|
6
|
+
it { is_expected.to respond_to :traverse }
|
7
|
+
it { is_expected.to respond_to :write_ea }
|
8
|
+
it { is_expected.to respond_to :read_ea }
|
9
|
+
it { is_expected.to respond_to :add_subdir }
|
10
|
+
it { is_expected.to respond_to :add_file }
|
11
|
+
it { is_expected.to respond_to :list }
|
12
|
+
it { is_expected.to respond_to :write_attr }
|
13
|
+
it { is_expected.to respond_to :synchronize }
|
14
|
+
it { is_expected.to respond_to :write_owner }
|
15
|
+
it { is_expected.to respond_to :write_dac }
|
16
|
+
it { is_expected.to respond_to :read_control }
|
17
|
+
it { is_expected.to respond_to :delete_access }
|
18
|
+
it { is_expected.to respond_to :generic_read }
|
19
|
+
it { is_expected.to respond_to :generic_write }
|
20
|
+
it { is_expected.to respond_to :generic_execute }
|
21
|
+
it { is_expected.to respond_to :generic_all }
|
22
|
+
it { is_expected.to respond_to :maximum }
|
23
|
+
it { is_expected.to respond_to :system_security }
|
24
|
+
|
25
|
+
it 'is little endian' do
|
26
|
+
expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#list' do
|
30
|
+
it 'should be a 1-bit field per the SMB spec' do
|
31
|
+
expect(flags.list).to be_a BinData::Bit1
|
32
|
+
end
|
33
|
+
|
34
|
+
it_behaves_like 'bit field with one flag set', :list, 'V', 0x00000001
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
describe '#add_file' do
|
39
|
+
it 'should be a 1-bit field per the SMB spec' do
|
40
|
+
expect(flags.add_file).to be_a BinData::Bit1
|
41
|
+
end
|
42
|
+
|
43
|
+
it_behaves_like 'bit field with one flag set', :add_file, 'V', 0x00000002
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#add_subdir' do
|
47
|
+
it 'should be a 1-bit field per the SMB spec' do
|
48
|
+
expect(flags.add_subdir).to be_a BinData::Bit1
|
49
|
+
end
|
50
|
+
|
51
|
+
it_behaves_like 'bit field with one flag set', :add_subdir, 'V', 0x00000004
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#read_ea' do
|
55
|
+
it 'should be a 1-bit field per the SMB spec' do
|
56
|
+
expect(flags.read_ea).to be_a BinData::Bit1
|
57
|
+
end
|
58
|
+
|
59
|
+
it_behaves_like 'bit field with one flag set', :read_ea, 'V', 0x00000008
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#write_ea' do
|
63
|
+
it 'should be a 1-bit field per the SMB spec' do
|
64
|
+
expect(flags.write_ea).to be_a BinData::Bit1
|
65
|
+
end
|
66
|
+
|
67
|
+
it_behaves_like 'bit field with one flag set', :write_ea, 'V', 0x00000010
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#traverse' do
|
71
|
+
it 'should be a 1-bit field per the SMB spec' do
|
72
|
+
expect(flags.traverse).to be_a BinData::Bit1
|
73
|
+
end
|
74
|
+
|
75
|
+
it_behaves_like 'bit field with one flag set', :traverse, 'V', 0x00000020
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#delete_child' do
|
79
|
+
it 'should be a 1-bit field per the SMB spec' do
|
80
|
+
expect(flags.delete_child).to be_a BinData::Bit1
|
81
|
+
end
|
82
|
+
|
83
|
+
it_behaves_like 'bit field with one flag set', :delete_child, 'V', 0x00000040
|
84
|
+
end
|
85
|
+
|
86
|
+
describe '#read_attr' do
|
87
|
+
it 'should be a 1-bit field per the SMB spec' do
|
88
|
+
expect(flags.read_attr).to be_a BinData::Bit1
|
89
|
+
end
|
90
|
+
|
91
|
+
it_behaves_like 'bit field with one flag set', :read_attr, 'V', 0x00000080
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#write_attr' do
|
95
|
+
it 'should be a 1-bit field per the SMB spec' do
|
96
|
+
expect(flags.write_attr).to be_a BinData::Bit1
|
97
|
+
end
|
98
|
+
|
99
|
+
it_behaves_like 'bit field with one flag set', :write_attr, 'V', 0x00000100
|
100
|
+
end
|
101
|
+
|
102
|
+
describe '#delete_access' do
|
103
|
+
it 'should be a 1-bit field per the SMB spec' do
|
104
|
+
expect(flags.delete_access).to be_a BinData::Bit1
|
105
|
+
end
|
106
|
+
|
107
|
+
it_behaves_like 'bit field with one flag set', :delete_access, 'V', 0x00010000
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '#read_control' do
|
111
|
+
it 'should be a 1-bit field per the SMB spec' do
|
112
|
+
expect(flags.read_control).to be_a BinData::Bit1
|
113
|
+
end
|
114
|
+
|
115
|
+
it_behaves_like 'bit field with one flag set', :read_control, 'V', 0x00020000
|
116
|
+
end
|
117
|
+
|
118
|
+
describe '#write_dac' do
|
119
|
+
it 'should be a 1-bit field per the SMB spec' do
|
120
|
+
expect(flags.write_dac).to be_a BinData::Bit1
|
121
|
+
end
|
122
|
+
|
123
|
+
it_behaves_like 'bit field with one flag set', :write_dac, 'V', 0x00040000
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '#write_owner' do
|
127
|
+
it 'should be a 1-bit field per the SMB spec' do
|
128
|
+
expect(flags.write_owner).to be_a BinData::Bit1
|
129
|
+
end
|
130
|
+
|
131
|
+
it_behaves_like 'bit field with one flag set', :write_owner, 'V', 0x00080000
|
132
|
+
end
|
133
|
+
|
134
|
+
describe '#synchronize' do
|
135
|
+
it 'should be a 1-bit field per the SMB spec' do
|
136
|
+
expect(flags.synchronize).to be_a BinData::Bit1
|
137
|
+
end
|
138
|
+
|
139
|
+
it_behaves_like 'bit field with one flag set', :synchronize, 'V', 0x00100000
|
140
|
+
end
|
141
|
+
|
142
|
+
describe '#system_security' do
|
143
|
+
it 'should be a 1-bit field per the SMB spec' do
|
144
|
+
expect(flags.system_security).to be_a BinData::Bit1
|
145
|
+
end
|
146
|
+
|
147
|
+
it_behaves_like 'bit field with one flag set', :system_security, 'V', 0x01000000
|
148
|
+
end
|
149
|
+
|
150
|
+
describe '#maximum' do
|
151
|
+
it 'should be a 1-bit field per the SMB spec' do
|
152
|
+
expect(flags.maximum).to be_a BinData::Bit1
|
153
|
+
end
|
154
|
+
|
155
|
+
it_behaves_like 'bit field with one flag set', :maximum, 'V', 0x02000000
|
156
|
+
end
|
157
|
+
|
158
|
+
describe '#generic_all' do
|
159
|
+
it 'should be a 1-bit field per the SMB spec' do
|
160
|
+
expect(flags.generic_all).to be_a BinData::Bit1
|
161
|
+
end
|
162
|
+
|
163
|
+
it_behaves_like 'bit field with one flag set', :generic_all, 'V', 0x10000000
|
164
|
+
end
|
165
|
+
|
166
|
+
describe '#generic_execute' do
|
167
|
+
it 'should be a 1-bit field per the SMB spec' do
|
168
|
+
expect(flags.generic_execute).to be_a BinData::Bit1
|
169
|
+
end
|
170
|
+
|
171
|
+
it_behaves_like 'bit field with one flag set', :generic_execute, 'V', 0x20000000
|
172
|
+
end
|
173
|
+
|
174
|
+
describe '#generic_write' do
|
175
|
+
it 'should be a 1-bit field per the SMB spec' do
|
176
|
+
expect(flags.generic_write).to be_a BinData::Bit1
|
177
|
+
end
|
178
|
+
|
179
|
+
it_behaves_like 'bit field with one flag set', :generic_write, 'V', 0x40000000
|
180
|
+
end
|
181
|
+
|
182
|
+
describe '#generic_read' do
|
183
|
+
it 'should be a 1-bit field per the SMB spec' do
|
184
|
+
expect(flags.generic_read).to be_a BinData::Bit1
|
185
|
+
end
|
186
|
+
|
187
|
+
it_behaves_like 'bit field with one flag set', :generic_read, 'V', 0x80000000
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
@@ -0,0 +1,190 @@
|
|
1
|
+
RSpec.describe RubySMB::SMB2::BitField::FileAccessMask do
|
2
|
+
subject(:flags) { described_class.new }
|
3
|
+
|
4
|
+
it { is_expected.to respond_to :read_attr }
|
5
|
+
it { is_expected.to respond_to :delete_child }
|
6
|
+
it { is_expected.to respond_to :execute }
|
7
|
+
it { is_expected.to respond_to :write_ea }
|
8
|
+
it { is_expected.to respond_to :read_ea }
|
9
|
+
it { is_expected.to respond_to :append_data }
|
10
|
+
it { is_expected.to respond_to :write_data }
|
11
|
+
it { is_expected.to respond_to :read_data }
|
12
|
+
it { is_expected.to respond_to :write_attr }
|
13
|
+
it { is_expected.to respond_to :synchronize }
|
14
|
+
it { is_expected.to respond_to :write_owner }
|
15
|
+
it { is_expected.to respond_to :write_dac }
|
16
|
+
it { is_expected.to respond_to :read_control }
|
17
|
+
it { is_expected.to respond_to :delete_access }
|
18
|
+
it { is_expected.to respond_to :generic_read }
|
19
|
+
it { is_expected.to respond_to :generic_write }
|
20
|
+
it { is_expected.to respond_to :generic_execute }
|
21
|
+
it { is_expected.to respond_to :generic_all }
|
22
|
+
it { is_expected.to respond_to :maximum }
|
23
|
+
it { is_expected.to respond_to :system_security }
|
24
|
+
|
25
|
+
it 'is little endian' do
|
26
|
+
expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#read_data' do
|
30
|
+
it 'should be a 1-bit field per the SMB spec' do
|
31
|
+
expect(flags.read_data).to be_a BinData::Bit1
|
32
|
+
end
|
33
|
+
|
34
|
+
it_behaves_like 'bit field with one flag set', :read_data, 'V', 0x00000001
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
describe '#write_data' do
|
39
|
+
it 'should be a 1-bit field per the SMB spec' do
|
40
|
+
expect(flags.write_data).to be_a BinData::Bit1
|
41
|
+
end
|
42
|
+
|
43
|
+
it_behaves_like 'bit field with one flag set', :write_data, 'V', 0x00000002
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#append_data' do
|
47
|
+
it 'should be a 1-bit field per the SMB spec' do
|
48
|
+
expect(flags.append_data).to be_a BinData::Bit1
|
49
|
+
end
|
50
|
+
|
51
|
+
it_behaves_like 'bit field with one flag set', :append_data, 'V', 0x00000004
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#read_ea' do
|
55
|
+
it 'should be a 1-bit field per the SMB spec' do
|
56
|
+
expect(flags.read_ea).to be_a BinData::Bit1
|
57
|
+
end
|
58
|
+
|
59
|
+
it_behaves_like 'bit field with one flag set', :read_ea, 'V', 0x00000008
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#write_ea' do
|
63
|
+
it 'should be a 1-bit field per the SMB spec' do
|
64
|
+
expect(flags.write_ea).to be_a BinData::Bit1
|
65
|
+
end
|
66
|
+
|
67
|
+
it_behaves_like 'bit field with one flag set', :write_ea, 'V', 0x00000010
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#execute' do
|
71
|
+
it 'should be a 1-bit field per the SMB spec' do
|
72
|
+
expect(flags.execute).to be_a BinData::Bit1
|
73
|
+
end
|
74
|
+
|
75
|
+
it_behaves_like 'bit field with one flag set', :execute, 'V', 0x00000020
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#delete_child' do
|
79
|
+
it 'should be a 1-bit field per the SMB spec' do
|
80
|
+
expect(flags.delete_child).to be_a BinData::Bit1
|
81
|
+
end
|
82
|
+
|
83
|
+
it_behaves_like 'bit field with one flag set', :delete_child, 'V', 0x00000040
|
84
|
+
end
|
85
|
+
|
86
|
+
describe '#read_attr' do
|
87
|
+
it 'should be a 1-bit field per the SMB spec' do
|
88
|
+
expect(flags.read_attr).to be_a BinData::Bit1
|
89
|
+
end
|
90
|
+
|
91
|
+
it_behaves_like 'bit field with one flag set', :read_attr, 'V', 0x00000080
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#write_attr' do
|
95
|
+
it 'should be a 1-bit field per the SMB spec' do
|
96
|
+
expect(flags.write_attr).to be_a BinData::Bit1
|
97
|
+
end
|
98
|
+
|
99
|
+
it_behaves_like 'bit field with one flag set', :write_attr, 'V', 0x00000100
|
100
|
+
end
|
101
|
+
|
102
|
+
describe '#delete_access' do
|
103
|
+
it 'should be a 1-bit field per the SMB spec' do
|
104
|
+
expect(flags.delete_access).to be_a BinData::Bit1
|
105
|
+
end
|
106
|
+
|
107
|
+
it_behaves_like 'bit field with one flag set', :delete_access, 'V', 0x00010000
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '#read_control' do
|
111
|
+
it 'should be a 1-bit field per the SMB spec' do
|
112
|
+
expect(flags.read_control).to be_a BinData::Bit1
|
113
|
+
end
|
114
|
+
|
115
|
+
it_behaves_like 'bit field with one flag set', :read_control, 'V', 0x00020000
|
116
|
+
end
|
117
|
+
|
118
|
+
describe '#write_dac' do
|
119
|
+
it 'should be a 1-bit field per the SMB spec' do
|
120
|
+
expect(flags.write_dac).to be_a BinData::Bit1
|
121
|
+
end
|
122
|
+
|
123
|
+
it_behaves_like 'bit field with one flag set', :write_dac, 'V', 0x00040000
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '#write_owner' do
|
127
|
+
it 'should be a 1-bit field per the SMB spec' do
|
128
|
+
expect(flags.write_owner).to be_a BinData::Bit1
|
129
|
+
end
|
130
|
+
|
131
|
+
it_behaves_like 'bit field with one flag set', :write_owner, 'V', 0x00080000
|
132
|
+
end
|
133
|
+
|
134
|
+
describe '#synchronize' do
|
135
|
+
it 'should be a 1-bit field per the SMB spec' do
|
136
|
+
expect(flags.synchronize).to be_a BinData::Bit1
|
137
|
+
end
|
138
|
+
|
139
|
+
it_behaves_like 'bit field with one flag set', :synchronize, 'V', 0x00100000
|
140
|
+
end
|
141
|
+
|
142
|
+
describe '#system_security' do
|
143
|
+
it 'should be a 1-bit field per the SMB spec' do
|
144
|
+
expect(flags.system_security).to be_a BinData::Bit1
|
145
|
+
end
|
146
|
+
|
147
|
+
it_behaves_like 'bit field with one flag set', :system_security, 'V', 0x01000000
|
148
|
+
end
|
149
|
+
|
150
|
+
describe '#maximum' do
|
151
|
+
it 'should be a 1-bit field per the SMB spec' do
|
152
|
+
expect(flags.maximum).to be_a BinData::Bit1
|
153
|
+
end
|
154
|
+
|
155
|
+
it_behaves_like 'bit field with one flag set', :maximum, 'V', 0x02000000
|
156
|
+
end
|
157
|
+
|
158
|
+
describe '#generic_all' do
|
159
|
+
it 'should be a 1-bit field per the SMB spec' do
|
160
|
+
expect(flags.generic_all).to be_a BinData::Bit1
|
161
|
+
end
|
162
|
+
|
163
|
+
it_behaves_like 'bit field with one flag set', :generic_all, 'V', 0x10000000
|
164
|
+
end
|
165
|
+
|
166
|
+
describe '#generic_execute' do
|
167
|
+
it 'should be a 1-bit field per the SMB spec' do
|
168
|
+
expect(flags.generic_execute).to be_a BinData::Bit1
|
169
|
+
end
|
170
|
+
|
171
|
+
it_behaves_like 'bit field with one flag set', :generic_execute, 'V', 0x20000000
|
172
|
+
end
|
173
|
+
|
174
|
+
describe '#generic_write' do
|
175
|
+
it 'should be a 1-bit field per the SMB spec' do
|
176
|
+
expect(flags.generic_write).to be_a BinData::Bit1
|
177
|
+
end
|
178
|
+
|
179
|
+
it_behaves_like 'bit field with one flag set', :generic_write, 'V', 0x40000000
|
180
|
+
end
|
181
|
+
|
182
|
+
describe '#generic_read' do
|
183
|
+
it 'should be a 1-bit field per the SMB spec' do
|
184
|
+
expect(flags.generic_read).to be_a BinData::Bit1
|
185
|
+
end
|
186
|
+
|
187
|
+
it_behaves_like 'bit field with one flag set', :generic_read, 'V', 0x80000000
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|