r15711: - make use of nttrans_setup_reply()
[metze/samba/wb-ndr.git] / source / smb_server / smb / nttrans.c
1 /* 
2    Unix SMB/CIFS implementation.
3    NT transaction handling
4    Copyright (C) Andrew Tridgell 2003
5    Copyright (C) James J Myers 2003 <myersjj@samba.org>
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21 /*
22    This file handles the parsing of transact2 requests
23 */
24
25 #include "includes.h"
26 #include "smb_server/smb_server.h"
27 #include "ntvfs/ntvfs.h"
28 #include "libcli/raw/libcliraw.h"
29 #include "librpc/gen_ndr/ndr_security.h"
30
31 /*
32   hold the state of a nttrans op while in progress. Needed to allow for async backend
33   functions.
34 */
35 struct nttrans_op {
36         struct smb_nttrans *trans;
37         NTSTATUS (*send_fn)(struct nttrans_op *);
38         void *op_info;
39 };
40
41
42 /* setup a nttrans reply, given the data and params sizes */
43 static NTSTATUS nttrans_setup_reply(struct nttrans_op *op, 
44                                     struct smb_nttrans *trans,
45                                     uint32_t param_size, uint32_t data_size,
46                                     uint8_t setup_count)
47 {
48         trans->out.setup_count = setup_count;
49         if (setup_count != 0) {
50                 trans->out.setup = talloc_zero_array(op, uint16_t, setup_count);
51                 NT_STATUS_HAVE_NO_MEMORY(trans->out.setup);
52         }
53         trans->out.params = data_blob_talloc(op, NULL, param_size);
54         if (param_size != 0) {
55                 NT_STATUS_HAVE_NO_MEMORY(trans->out.params.data);
56         }
57         trans->out.data = data_blob_talloc(op, NULL, data_size);
58         if (data_size != 0) {
59                 NT_STATUS_HAVE_NO_MEMORY(trans->out.data.data);
60         }
61         return NT_STATUS_OK;
62 }
63
64 /*
65   send a nttrans create reply
66 */
67 static NTSTATUS nttrans_create_send(struct nttrans_op *op)
68 {
69         union smb_open *io = talloc_get_type(op->op_info, union smb_open);
70         uint8_t *params;
71         NTSTATUS status;
72
73         status = nttrans_setup_reply(op, op->trans, 69, 0, 0);
74         NT_STATUS_NOT_OK_RETURN(status);
75         params = op->trans->out.params.data;
76
77         SSVAL(params,        0, io->ntcreatex.out.oplock_level);
78         SSVAL(params,        2, io->ntcreatex.out.file.fnum);
79         SIVAL(params,        4, io->ntcreatex.out.create_action);
80         SIVAL(params,        8, 0); /* ea error offset */
81         push_nttime(params, 12, io->ntcreatex.out.create_time);
82         push_nttime(params, 20, io->ntcreatex.out.access_time);
83         push_nttime(params, 28, io->ntcreatex.out.write_time);
84         push_nttime(params, 36, io->ntcreatex.out.change_time);
85         SIVAL(params,       44, io->ntcreatex.out.attrib);
86         SBVAL(params,       48, io->ntcreatex.out.alloc_size);
87         SBVAL(params,       56, io->ntcreatex.out.size);
88         SSVAL(params,       64, io->ntcreatex.out.file_type);
89         SSVAL(params,       66, io->ntcreatex.out.ipc_state);
90         SCVAL(params,       68, io->ntcreatex.out.is_directory);
91
92         return NT_STATUS_OK;
93 }
94
95 /* 
96    parse NTTRANS_CREATE request
97  */
98 static NTSTATUS nttrans_create(struct smbsrv_request *req, 
99                                struct nttrans_op *op)
100 {
101         struct smb_nttrans *trans = op->trans;
102         union smb_open *io;
103         uint16_t fname_len;
104         uint32_t sd_length, ea_length;
105         NTSTATUS status;
106         uint8_t *params;
107
108         if (trans->in.params.length < 54) {
109                 return NT_STATUS_INVALID_PARAMETER;
110         }
111
112         /* parse the request */
113         io = talloc(op, union smb_open);
114         NT_STATUS_HAVE_NO_MEMORY(io);
115
116         io->ntcreatex.level = RAW_OPEN_NTTRANS_CREATE;
117
118         params = trans->in.params.data;
119
120         io->ntcreatex.in.flags            = IVAL(params,  0);
121         io->ntcreatex.in.root_fid         = IVAL(params,  4);
122         io->ntcreatex.in.access_mask      = IVAL(params,  8);
123         io->ntcreatex.in.alloc_size       = BVAL(params, 12);
124         io->ntcreatex.in.file_attr        = IVAL(params, 20);
125         io->ntcreatex.in.share_access     = IVAL(params, 24);
126         io->ntcreatex.in.open_disposition = IVAL(params, 28);
127         io->ntcreatex.in.create_options   = IVAL(params, 32);
128         sd_length                         = IVAL(params, 36);
129         ea_length                         = IVAL(params, 40);
130         fname_len                         = IVAL(params, 44);
131         io->ntcreatex.in.impersonation    = IVAL(params, 48);
132         io->ntcreatex.in.security_flags   = CVAL(params, 52);
133         io->ntcreatex.in.sec_desc         = NULL;
134         io->ntcreatex.in.ea_list          = NULL;
135
136         req_pull_string(req, &io->ntcreatex.in.fname, 
137                         params + 53, 
138                         MIN(fname_len+1, trans->in.params.length - 53),
139                         STR_NO_RANGE_CHECK | STR_TERMINATE);
140         if (!io->ntcreatex.in.fname) {
141                 return NT_STATUS_INVALID_PARAMETER;
142         }
143
144         if (sd_length > trans->in.data.length ||
145             ea_length > trans->in.data.length ||
146             (sd_length+ea_length) > trans->in.data.length) {
147                 return NT_STATUS_INVALID_PARAMETER;
148         }
149
150         /* this call has an optional security descriptor */
151         if (sd_length != 0) {
152                 DATA_BLOB blob;
153                 blob.data = trans->in.data.data;
154                 blob.length = sd_length;
155                 io->ntcreatex.in.sec_desc = talloc(io, struct security_descriptor);
156                 if (io->ntcreatex.in.sec_desc == NULL) {
157                         return NT_STATUS_NO_MEMORY;
158                 }
159                 status = ndr_pull_struct_blob(&blob, io, 
160                                               io->ntcreatex.in.sec_desc, 
161                                               (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
162                 if (!NT_STATUS_IS_OK(status)) {
163                         return status;
164                 }
165         }
166
167         /* and an optional ea_list */
168         if (ea_length > 4) {
169                 DATA_BLOB blob;
170                 blob.data = trans->in.data.data + sd_length;
171                 blob.length = ea_length;
172                 io->ntcreatex.in.ea_list = talloc(io, struct smb_ea_list);
173                 if (io->ntcreatex.in.ea_list == NULL) {
174                         return NT_STATUS_NO_MEMORY;
175                 }
176
177                 status = ea_pull_list_chained(&blob, io, 
178                                               &io->ntcreatex.in.ea_list->num_eas,
179                                               &io->ntcreatex.in.ea_list->eas);
180                 if (!NT_STATUS_IS_OK(status)) {
181                         return status;
182                 }
183         }
184
185         op->send_fn = nttrans_create_send;
186         op->op_info = io;
187
188         return ntvfs_open(req->ntvfs, io);
189 }
190
191
192 /* 
193    send NTTRANS_QUERY_SEC_DESC reply
194  */
195 static NTSTATUS nttrans_query_sec_desc_send(struct nttrans_op *op)
196 {
197         union smb_fileinfo *io = talloc_get_type(op->op_info, union smb_fileinfo);
198         uint8_t *params;
199         NTSTATUS status;
200
201         status = nttrans_setup_reply(op, op->trans, 4, 0, 0);
202         NT_STATUS_NOT_OK_RETURN(status);
203         params = op->trans->out.params.data;
204
205         status = ndr_push_struct_blob(&op->trans->out.data, op, 
206                                       io->query_secdesc.out.sd, 
207                                       (ndr_push_flags_fn_t)ndr_push_security_descriptor);
208         NT_STATUS_NOT_OK_RETURN(status);
209
210         SIVAL(params, 0, op->trans->out.data.length);
211
212         return NT_STATUS_OK;
213 }
214
215 /* 
216    parse NTTRANS_QUERY_SEC_DESC request
217  */
218 static NTSTATUS nttrans_query_sec_desc(struct smbsrv_request *req, 
219                                        struct nttrans_op *op)
220 {
221         struct smb_nttrans *trans = op->trans;
222         union smb_fileinfo *io;
223
224         if (trans->in.params.length < 8) {
225                 return NT_STATUS_INVALID_PARAMETER;
226         }
227
228         /* parse the request */
229         io = talloc(op, union smb_fileinfo);
230         NT_STATUS_HAVE_NO_MEMORY(io);
231
232         io->query_secdesc.level            = RAW_FILEINFO_SEC_DESC;
233         io->query_secdesc.in.file.fnum     = SVAL(trans->in.params.data, 0);
234         io->query_secdesc.in.secinfo_flags = IVAL(trans->in.params.data, 4);
235
236         op->op_info = io;
237         op->send_fn = nttrans_query_sec_desc_send;
238
239         return ntvfs_qfileinfo(req->ntvfs, io);
240 }
241
242
243 /* 
244    parse NTTRANS_SET_SEC_DESC request
245  */
246 static NTSTATUS nttrans_set_sec_desc(struct smbsrv_request *req, 
247                                      struct nttrans_op *op)
248 {
249         struct smb_nttrans *trans = op->trans;
250         union smb_setfileinfo *io;
251         NTSTATUS status;
252
253         if (trans->in.params.length < 8) {
254                 return NT_STATUS_INVALID_PARAMETER;
255         }
256
257         /* parse the request */
258         io = talloc(req, union smb_setfileinfo);
259         NT_STATUS_HAVE_NO_MEMORY(io);
260
261         io->set_secdesc.level            = RAW_SFILEINFO_SEC_DESC;
262         io->set_secdesc.in.file.fnum     = SVAL(trans->in.params.data, 0);
263         io->set_secdesc.in.secinfo_flags = IVAL(trans->in.params.data, 4);
264
265         io->set_secdesc.in.sd = talloc(io, struct security_descriptor);
266         NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd);
267
268         status = ndr_pull_struct_blob(&trans->in.data, req, 
269                                       io->set_secdesc.in.sd, 
270                                       (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
271         NT_STATUS_NOT_OK_RETURN(status);
272
273         return ntvfs_setfileinfo(req->ntvfs, io);
274 }
275
276
277 /* parse NTTRANS_RENAME request
278  */
279 static NTSTATUS nttrans_rename(struct smbsrv_request *req, 
280                                struct nttrans_op *op)
281 {
282         return NT_STATUS_NOT_IMPLEMENTED;
283 }
284
285 /* 
286    parse NTTRANS_IOCTL request
287  */
288 static NTSTATUS nttrans_ioctl(struct smbsrv_request *req, 
289                               struct nttrans_op *op)
290 {
291         struct smb_nttrans *trans = op->trans;
292         union smb_ioctl *nt;
293         uint32_t function;
294         uint16_t fnum;
295         uint8_t filter;
296         BOOL fsctl;
297         NTSTATUS status;
298
299         /* should have at least 4 setup words */
300         if (trans->in.setup_count != 4) {
301                 return NT_STATUS_INVALID_PARAMETER;
302         }
303
304         nt = talloc(op, union smb_ioctl);
305         NT_STATUS_HAVE_NO_MEMORY(nt);
306         
307         function  = IVAL(trans->in.setup, 0);
308         fnum  = SVAL(trans->in.setup, 4);
309         fsctl = CVAL(trans->in.setup, 6);
310         filter = CVAL(trans->in.setup, 7);
311
312         nt->ntioctl.level = RAW_IOCTL_NTIOCTL;
313         nt->ntioctl.in.file.fnum = fnum;
314         nt->ntioctl.in.function = function;
315         nt->ntioctl.in.fsctl = fsctl;
316         nt->ntioctl.in.filter = filter;
317         nt->ntioctl.in.max_data = trans->in.max_data;
318         nt->ntioctl.in.blob = trans->in.data;
319
320         status = nttrans_setup_reply(op, trans, 0, 0, 1);
321         NT_STATUS_NOT_OK_RETURN(status);
322
323         trans->out.setup[0] = 0;
324         
325         return ntvfs_ioctl(req->ntvfs, nt);
326 }
327
328
329 /* 
330    send NTTRANS_NOTIFY_CHANGE reply
331  */
332 static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
333 {
334         struct smb_notify *info = talloc_get_type(op->op_info, struct smb_notify);
335         size_t size = 0;
336         int i;
337         NTSTATUS status;
338         uint8_t *p;
339 #define MAX_BYTES_PER_CHAR 3
340         
341         /* work out how big the reply buffer could be */
342         for (i=0;i<info->out.num_changes;i++) {
343                 size += 12 + 3 + (1+strlen(info->out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
344         }
345
346         status = nttrans_setup_reply(op, op->trans, size, 0, 0);
347         NT_STATUS_NOT_OK_RETURN(status);
348         p = op->trans->out.params.data;
349
350         /* construct the changes buffer */
351         for (i=0;i<info->out.num_changes;i++) {
352                 uint32_t ofs;
353                 ssize_t len;
354
355                 SIVAL(p, 4, info->out.changes[i].action);
356                 len = push_string(p + 12, info->out.changes[i].name.s, 
357                                   op->trans->out.params.length - 
358                                   (p+12 - op->trans->out.params.data), STR_UNICODE);
359                 SIVAL(p, 8, len);
360                 
361                 ofs = len + 12;
362
363                 if (ofs & 3) {
364                         int pad = 4 - (ofs & 3);
365                         memset(p+ofs, 0, pad);
366                         ofs += pad;
367                 }
368
369                 if (i == info->out.num_changes-1) {
370                         SIVAL(p, 0, 0);
371                 } else {
372                         SIVAL(p, 0, ofs);
373                 }
374
375                 p += ofs;
376         }
377
378         op->trans->out.params.length = p - op->trans->out.params.data;
379
380         return NT_STATUS_OK;
381 }
382
383 /* 
384    parse NTTRANS_NOTIFY_CHANGE request
385  */
386 static NTSTATUS nttrans_notify_change(struct smbsrv_request *req, 
387                                       struct nttrans_op *op)
388 {
389         struct smb_nttrans *trans = op->trans;
390         struct smb_notify *info;
391
392         /* should have at least 4 setup words */
393         if (trans->in.setup_count != 4) {
394                 return NT_STATUS_INVALID_PARAMETER;
395         }
396
397         info = talloc(op, struct smb_notify);
398         NT_STATUS_HAVE_NO_MEMORY(info);
399
400         info->in.completion_filter = IVAL(trans->in.setup, 0);
401         info->in.file.fnum         = SVAL(trans->in.setup, 4);
402         info->in.recursive         = SVAL(trans->in.setup, 6);
403         info->in.buffer_size       = trans->in.max_param;
404
405         op->op_info = info;
406         op->send_fn = nttrans_notify_change_send;
407         
408         return ntvfs_notify(req->ntvfs, info);
409 }
410
411 /*
412   backend for nttrans requests
413 */
414 static NTSTATUS nttrans_backend(struct smbsrv_request *req, 
415                                 struct nttrans_op *op)
416 {
417         /* the nttrans command is in function */
418         switch (op->trans->in.function) {
419         case NT_TRANSACT_CREATE:
420                 return nttrans_create(req, op);
421         case NT_TRANSACT_IOCTL:
422                 return nttrans_ioctl(req, op);
423         case NT_TRANSACT_RENAME:
424                 return nttrans_rename(req, op);
425         case NT_TRANSACT_QUERY_SECURITY_DESC:
426                 return nttrans_query_sec_desc(req, op);
427         case NT_TRANSACT_SET_SECURITY_DESC:
428                 return nttrans_set_sec_desc(req, op);
429         case NT_TRANSACT_NOTIFY_CHANGE:
430                 return nttrans_notify_change(req, op);
431         }
432
433         /* an unknown nttrans command */
434         return NT_STATUS_DOS(ERRSRV, ERRerror);
435 }
436
437
438 static void reply_nttrans_send(struct ntvfs_request *ntvfs)
439 {
440         struct smbsrv_request *req;
441         uint16_t params_left, data_left;
442         uint8_t *params, *data;
443         struct smb_nttrans *trans;
444         struct nttrans_op *op;
445
446         SMBSRV_CHECK_ASYNC_STATUS(op, struct nttrans_op);
447
448         trans = op->trans;
449
450         /* if this function needs work to form the nttrans reply buffer, then
451            call that now */
452         if (op->send_fn != NULL) {
453                 NTSTATUS status;
454                 status = op->send_fn(op);
455                 if (!NT_STATUS_IS_OK(status)) {
456                         smbsrv_send_error(req, status);
457                         return;
458                 }
459         }
460
461         smbsrv_setup_reply(req, 18 + trans->out.setup_count, 0);
462
463         /* note that we don't check the max_setup count (matching w2k3
464            behaviour) */
465
466         if (trans->out.params.length > trans->in.max_param) {
467                 smbsrv_setup_error(req, NT_STATUS_BUFFER_TOO_SMALL);
468                 trans->out.params.length = trans->in.max_param;
469         }
470         if (trans->out.data.length > trans->in.max_data) {
471                 smbsrv_setup_error(req, NT_STATUS_BUFFER_TOO_SMALL);
472                 trans->out.data.length = trans->in.max_data;
473         }
474
475         params_left = trans->out.params.length;
476         data_left   = trans->out.data.length;
477         params      = trans->out.params.data;
478         data        = trans->out.data.data;
479
480         /* we need to divide up the reply into chunks that fit into
481            the negotiated buffer size */
482         do {
483                 uint16_t this_data, this_param, max_bytes;
484                 uint_t align1 = 1, align2 = (params_left ? 2 : 0);
485                 struct smbsrv_request *this_req;
486                 int i;
487
488                 max_bytes = req_max_data(req) - (align1 + align2);
489
490                 this_param = params_left;
491                 if (this_param > max_bytes) {
492                         this_param = max_bytes;
493                 }
494                 max_bytes -= this_param;
495
496                 this_data = data_left;
497                 if (this_data > max_bytes) {
498                         this_data = max_bytes;
499                 }
500
501                 /* don't destroy unless this is the last chunk */
502                 if (params_left - this_param != 0 || 
503                     data_left - this_data != 0) {
504                         this_req = smbsrv_setup_secondary_request(req);
505                 } else {
506                         this_req = req;
507                 }
508
509                 req_grow_data(req, this_param + this_data + (align1 + align2));
510
511                 SSVAL(this_req->out.vwv, 0, 0); /* reserved */
512                 SCVAL(this_req->out.vwv, 2, 0); /* reserved */
513                 SIVAL(this_req->out.vwv, 3, trans->out.params.length);
514                 SIVAL(this_req->out.vwv, 7, trans->out.data.length);
515
516                 SIVAL(this_req->out.vwv, 11, this_param);
517                 SIVAL(this_req->out.vwv, 15, align1 + PTR_DIFF(this_req->out.data, this_req->out.hdr));
518                 SIVAL(this_req->out.vwv, 19, PTR_DIFF(params, trans->out.params.data));
519
520                 SIVAL(this_req->out.vwv, 23, this_data);
521                 SIVAL(this_req->out.vwv, 27, align1 + align2 + 
522                       PTR_DIFF(this_req->out.data + this_param, this_req->out.hdr));
523                 SIVAL(this_req->out.vwv, 31, PTR_DIFF(data, trans->out.data.data));
524
525                 SCVAL(this_req->out.vwv, 35, trans->out.setup_count);
526                 for (i=0;i<trans->out.setup_count;i++) {
527                         SSVAL(this_req->out.vwv, VWV(18+i), trans->out.setup[i]);
528                 }
529
530                 memset(this_req->out.data, 0, align1);
531                 if (this_param != 0) {
532                         memcpy(this_req->out.data + align1, params, this_param);
533                 }
534                 memset(this_req->out.data+this_param+align1, 0, align2);
535                 if (this_data != 0) {
536                         memcpy(this_req->out.data+this_param+align1+align2, 
537                                data, this_data);
538                 }
539
540                 params_left -= this_param;
541                 data_left -= this_data;
542                 params += this_param;
543                 data += this_data;
544
545                 smbsrv_send_reply(this_req);
546         } while (params_left != 0 || data_left != 0);
547 }
548
549
550 /****************************************************************************
551  Reply to an SMBnttrans request
552 ****************************************************************************/
553 void smbsrv_reply_nttrans(struct smbsrv_request *req)
554 {
555         struct nttrans_op *op;
556         struct smb_nttrans *trans;
557         int i;
558         uint16_t param_ofs, data_ofs;
559         uint16_t param_count, data_count;
560         uint16_t param_total, data_total;
561
562         /* parse request */
563         if (req->in.wct < 19) {
564                 smbsrv_send_error(req, NT_STATUS_FOOBAR);
565                 return;
566         }
567
568         SMBSRV_TALLOC_IO_PTR(op, struct nttrans_op);
569         SMBSRV_SETUP_NTVFS_REQUEST(reply_nttrans_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
570
571         trans = talloc(op, struct smb_nttrans);
572         if (trans == NULL) {
573                 smbsrv_send_error(req, NT_STATUS_NO_MEMORY);
574                 return;
575         }
576
577         op->trans = trans;
578         op->op_info = NULL;
579         op->send_fn = NULL;
580
581         trans->in.max_setup  = CVAL(req->in.vwv, 0);
582         param_total          = IVAL(req->in.vwv, 3);
583         data_total           = IVAL(req->in.vwv, 7);
584         trans->in.max_param  = IVAL(req->in.vwv, 11);
585         trans->in.max_data   = IVAL(req->in.vwv, 15);
586         param_count          = IVAL(req->in.vwv, 19);
587         param_ofs            = IVAL(req->in.vwv, 23);
588         data_count           = IVAL(req->in.vwv, 27);
589         data_ofs             = IVAL(req->in.vwv, 31);
590         trans->in.setup_count= CVAL(req->in.vwv, 35);
591         trans->in.function   = SVAL(req->in.vwv, 36);
592
593         if (req->in.wct != 19 + trans->in.setup_count) {
594                 smbsrv_send_error(req, NT_STATUS_DOS(ERRSRV, ERRerror));
595                 return;
596         }
597
598         /* parse out the setup words */
599         trans->in.setup = talloc_array(req, uint16_t, trans->in.setup_count);
600         if (!trans->in.setup) {
601                 smbsrv_send_error(req, NT_STATUS_NO_MEMORY);
602                 return;
603         }
604         for (i=0;i<trans->in.setup_count;i++) {
605                 trans->in.setup[i] = SVAL(req->in.vwv, VWV(19+i));
606         }
607
608         if (!req_pull_blob(req, req->in.hdr + param_ofs, param_count, &trans->in.params) ||
609             !req_pull_blob(req, req->in.hdr + data_ofs, data_count, &trans->in.data)) {
610                 smbsrv_send_error(req, NT_STATUS_FOOBAR);
611                 return;
612         }
613
614         /* is it a partial request? if so, then send a 'send more' message */
615         if (param_total > param_count ||
616             data_total > data_count) {
617                 DEBUG(0,("REWRITE: not handling partial nttrans requests!\n"));
618                 smbsrv_send_error(req, NT_STATUS_FOOBAR);
619                 return;
620         }
621
622         ZERO_STRUCT(trans->out);
623         SMBSRV_CALL_NTVFS_BACKEND(nttrans_backend(req, op));
624 }
625
626
627 /****************************************************************************
628  Reply to an SMBnttranss request
629 ****************************************************************************/
630 void smbsrv_reply_nttranss(struct smbsrv_request *req)
631 {
632         smbsrv_send_error(req, NT_STATUS_FOOBAR);
633 }