Print this page
NEX-14666 Need to provide SMB 2.1 Client
NEX-17187 panic in smbfs_acl_store
NEX-17231 smbfs create xattr files finds wrong file
NEX-17224 smbfs lookup EINVAL should be ENOENT
NEX-17260 SMB1 client fails to list directory after NEX-14666
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
and: (cleanup)
NEX-10455 Ricoh scanner error after DFS get referral
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>
NEX-5844 want SMB2 ioctl FSCTL_SRV_COPYCHUNK
NEX-6124 smb_fsop_read/write should allow file != sr->fid_ofile
NEX-6125 smbtorture invalid response with smb2.ioctl
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
SMB-11 SMB2 message parse & dispatch
SMB-12 SMB2 Negotiate Protocol
SMB-13 SMB2 Session Setup
SMB-14 SMB2 Logoff
SMB-15 SMB2 Tree Connect
SMB-16 SMB2 Tree Disconnect
SMB-17 SMB2 Create
SMB-18 SMB2 Close
SMB-19 SMB2 Flush
SMB-20 SMB2 Read
SMB-21 SMB2 Write
SMB-22 SMB2 Lock/Unlock
SMB-23 SMB2 Ioctl
SMB-24 SMB2 Cancel
SMB-25 SMB2 Echo
SMB-26 SMB2 Query Dir
SMB-27 SMB2 Change Notify
SMB-28 SMB2 Query Info
SMB-29 SMB2 Set Info
SMB-30 SMB2 Oplocks
SMB-53 SMB2 Create Context options
(SMB2 code review cleanup 1, 2, 3)
SMB-50 User-mode SMB server
Includes work by these authors:
Thomas Keiser <thomas.keiser@nexenta.com>
Albert Lee <trisk@nexenta.com>
SMB-65 SMB server in non-global zones (data structure changes)
Many things move to the smb_server_t object, and
many functions gain an sv arg (which server).
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/fs/smbsrv/smb_trans2_dfs.c
+++ new/usr/src/uts/common/fs/smbsrv/smb_trans2_dfs.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 *
25 - * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
25 + * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
26 26 */
27 27
28 28 #include <smbsrv/smb_kproto.h>
29 -#include <smbsrv/winioctl.h>
29 +#include <smb/winioctl.h>
30 30
31 31 /*
32 32 * [MS-CIFS]
33 33 *
34 34 * 2.2.6.17 TRANS2_REPORT_DFS_INCONSISTENCY (0x0011)
35 35 *
36 36 * This Transaction2 subcommand was introduced in the NT LAN Manager dialect.
37 37 * This subcommand is reserved but not implemented.
38 38 *
39 39 * Clients SHOULD NOT send requests using this command code. Servers receiving
40 40 * requests with this command code SHOULD return STATUS_NOT_IMPLEMENTED
41 41 * (ERRDOS/ERRbadfunc).
42 42 */
43 43 smb_sdrc_t /*ARGSUSED*/
44 44 smb_com_trans2_report_dfs_inconsistency(smb_request_t *sr)
45 45 {
46 46 return (SDRC_NOT_IMPLEMENTED);
47 47 }
48 48
49 49 /*
50 50 * See [MS-DFSC] for details about this command
51 51 */
52 52 smb_sdrc_t
53 53 smb_com_trans2_get_dfs_referral(smb_request_t *sr, smb_xa_t *xa)
54 54 {
55 55 smb_fsctl_t fsctl;
56 56 uint32_t status;
57 57 uint16_t doserr;
58 58
59 59 /* This request is only valid over IPC connections */
60 60 if (!STYPE_ISIPC(sr->tid_tree->t_res_type)) {
61 61 smbsr_error(sr, NT_STATUS_ACCESS_DENIED, ERRDOS,
62 62 ERROR_ACCESS_DENIED);
63 63 return (SDRC_ERROR);
64 64 }
|
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
65 65
66 66 fsctl.CtlCode = FSCTL_DFS_GET_REFERRALS;
67 67 fsctl.InputCount = xa->smb_tpscnt;
68 68 fsctl.OutputCount = 0;
69 69 fsctl.MaxOutputResp = xa->smb_mdrcnt;
70 70 fsctl.in_mbc = &xa->req_param_mb;
71 71 fsctl.out_mbc = &xa->rep_data_mb;
72 72
73 73 status = smb_dfs_get_referrals(sr, &fsctl);
74 74
75 - /* Out param is the API-level return code. */
75 + /*
76 + * Out param is the API-level return code.
77 + * Out data (rep_data_mb) is the referral.
78 + */
76 79 doserr = smb_status2doserr(status);
77 80 (void) smb_mbc_encodef(&xa->rep_param_mb, "w", doserr);
78 -
79 -#if 0 /* XXX - Is API-level return code enough? */
80 - if (status) {
81 - smbsr_error(sr, NT_STATUS_NO_SUCH_DEVICE, 0, 0);
81 + if (status != 0) {
82 + smbsr_error(sr, status, ERRDOS, doserr);
82 83 return (SDRC_ERROR);
83 84 }
84 -#endif
85 85
86 86 return (SDRC_SUCCESS);
87 87 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX