Print this page
NEX-17095 illumos 8935 SMB ioctl fixes incomplete
8935 SMB ioctl fixes incomplete
Reviewed by: Alex Wilson <alex.wilson@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Rui Loura <rui.loura@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Dominik Hassler <hasslerd@gmx.li>
Approved by: Garrett D'Amore <garrett@damore.org>
NEX-10019 SMB server min_protocol setting
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-5273 SMB 3 Encryption
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-4083 Upstream changes from illumos 5917 and 5995
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-3611 CLONE NEX-3550 Replace smb2_enable with max_protocol
Reviewed by: Yuri Pankov <Yuri.Pankov@nexenta.com>
NEX-1050 enable_smb2 should be smb2_enable
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-72 Improve startup/shudown debug features
SMB-56 extended security NTLMSSP, inbound
SMB-50 User-mode SMB server
Includes work by these authors:
Thomas Keiser <thomas.keiser@nexenta.com>
Albert Lee <trisk@nexenta.com>
re #6813 rb1757 port 2976 Child folder visibility through shares
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/smbsrv/smb_ioctl.h
+++ new/usr/src/uts/common/smbsrv/smb_ioctl.h
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 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
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.
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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 - * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
23 + * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
24 24 * Copyright 2017 Joyent, Inc.
25 25 */
26 26
27 27 #ifndef _SMB_IOCTL_H_
28 28 #define _SMB_IOCTL_H_
29 29
30 30 #ifdef __cplusplus
31 31 extern "C" {
32 32 #endif
33 33
34 34 #include <sys/types.h>
35 35 #include <sys/param.h>
36 36 #include <smbsrv/smbinfo.h>
37 37
38 38 #define SMB_IOC_VERSION 0x534D4201 /* SMB1 */
39 39
40 40 #define SMB_IOC_BASE (('S' << 16) | ('B' << 8))
41 41
42 42 #define SMB_IOC_CONFIG _IOW(SMB_IOC_BASE, 1, int)
43 43 #define SMB_IOC_START _IOW(SMB_IOC_BASE, 2, int)
44 44 #define SMB_IOC_GMTOFF _IOW(SMB_IOC_BASE, 3, int)
45 45 #define SMB_IOC_SHARE _IOW(SMB_IOC_BASE, 4, int)
46 46 #define SMB_IOC_UNSHARE _IOW(SMB_IOC_BASE, 5, int)
47 47 #define SMB_IOC_NUMOPEN _IOW(SMB_IOC_BASE, 6, int)
48 48 #define SMB_IOC_SVCENUM _IOW(SMB_IOC_BASE, 7, int)
49 49 #define SMB_IOC_FILE_CLOSE _IOW(SMB_IOC_BASE, 8, int)
50 50 #define SMB_IOC_SESSION_CLOSE _IOW(SMB_IOC_BASE, 9, int)
51 51 #define SMB_IOC_STOP _IOW(SMB_IOC_BASE, 10, int)
52 52 #define SMB_IOC_EVENT _IOW(SMB_IOC_BASE, 11, int)
53 53 #define SMB_IOC_SHAREINFO _IOW(SMB_IOC_BASE, 12, int)
54 54 #define SMB_IOC_SPOOLDOC _IOW(SMB_IOC_BASE, 13, int)
55 55
56 56 typedef struct smb_ioc_header {
57 57 uint32_t version;
58 58 uint32_t crc;
59 59 uint32_t len;
60 60 int cmd;
61 61 } smb_ioc_header_t;
62 62
63 63 typedef struct smb_ioc_spooldoc {
64 64 smb_ioc_header_t hdr;
65 65 smb_inaddr_t ipaddr;
66 66 uint32_t spool_num;
67 67 char username[MAXNAMELEN];
68 68 char path[MAXPATHLEN];
69 69 } smb_ioc_spooldoc_t;
70 70
71 71 typedef struct {
72 72 smb_ioc_header_t hdr;
73 73 int32_t offset;
74 74 } smb_ioc_gmt_t;
75 75
76 76 typedef struct smb_ioc_share {
77 77 smb_ioc_header_t hdr;
78 78 uint32_t shrlen;
79 79 char shr[1];
80 80 } smb_ioc_share_t;
81 81
82 82 typedef struct smb_ioc_shareinfo {
83 83 smb_ioc_header_t hdr;
84 84 char shrname[MAXNAMELEN];
85 85 uint32_t shortnames;
86 86 } smb_ioc_shareinfo_t;
87 87
88 88 typedef struct smb_ioc_start {
89 89 smb_ioc_header_t hdr;
90 90 int opipe;
91 91 int lmshrd;
92 92 int udoor;
93 93 /* These are used only by libfksmbsrv */
94 94 void *opipe_func;
95 95 void *lmshr_func;
96 96 void *udoor_func;
97 97 } smb_ioc_start_t;
98 98
99 99 typedef struct smb_ioc_event {
100 100 smb_ioc_header_t hdr;
101 101 uint32_t txid;
102 102 } smb_ioc_event_t;
103 103
104 104 typedef struct smb_ioc_opennum {
105 105 smb_ioc_header_t hdr;
106 106 uint32_t open_users;
107 107 uint32_t open_trees;
108 108 uint32_t open_files;
109 109 uint32_t qualtype;
110 110 char qualifier[MAXNAMELEN];
111 111 } smb_ioc_opennum_t;
112 112
113 113 /*
114 114 * For enumeration, user and session are synonymous, as are
115 115 * connection and tree.
116 116 */
117 117 #define SMB_SVCENUM_TYPE_USER 0x55534552 /* 'USER' */
118 118 #define SMB_SVCENUM_TYPE_TREE 0x54524545 /* 'TREE' */
119 119 #define SMB_SVCENUM_TYPE_FILE 0x46494C45 /* 'FILE' */
120 120 #define SMB_SVCENUM_TYPE_SHARE 0x53484152 /* 'SHAR' */
121 121
122 122 /* Maximum size of payload data an smbsrv ioctl may use. */
123 123 #define SMB_IOC_DATA_SIZE (256 * 1024)
124 124
125 125 typedef struct smb_svcenum {
126 126 uint32_t se_type; /* object type to enumerate */
127 127 uint32_t se_level; /* level of detail being requested */
128 128 uint32_t se_prefmaxlen; /* client max size buffer preference */
129 129 /* (ignored by kernel) */
130 130 uint32_t se_resume; /* client resume handle */
131 131 uint32_t se_bavail; /* remaining buffer space in bytes */
132 132 uint32_t se_bused; /* consumed buffer space in bytes */
133 133 uint32_t se_ntotal; /* total number of objects */
134 134 uint32_t se_nlimit; /* max number of objects to return */
135 135 uint32_t se_nitems; /* number of objects in buf */
136 136 uint32_t se_nskip; /* number of objects to skip */
137 137 uint32_t se_status; /* enumeration status */
138 138 uint32_t se_buflen; /* length of the buffer in bytes */
139 139 uint8_t se_buf[1]; /* buffer to hold enumeration data */
140 140 } smb_svcenum_t;
141 141
142 142 typedef struct smb_ioc_svcenum {
143 143 smb_ioc_header_t hdr;
144 144 smb_svcenum_t svcenum;
145 145 } smb_ioc_svcenum_t;
146 146
147 147 typedef struct smb_ioc_session {
148 148 smb_ioc_header_t hdr;
149 149 char client[MAXNAMELEN];
150 150 char username[MAXNAMELEN];
151 151 } smb_ioc_session_t;
152 152
153 153 typedef struct smb_ioc_fileid {
154 154 smb_ioc_header_t hdr;
155 155 uint32_t uniqid;
156 156 } smb_ioc_fileid_t;
157 157
158 158 /* See also: smb_kmod_cfg_t */
159 159 typedef struct smb_ioc_cfg {
160 160 smb_ioc_header_t hdr;
161 161 uint32_t maxworkers;
162 162 uint32_t maxconnections;
163 163 uint32_t keepalive;
164 164 int32_t restrict_anon;
|
↓ open down ↓ |
131 lines elided |
↑ open up ↑ |
165 165 int32_t signing_enable;
166 166 int32_t signing_required;
167 167 int32_t oplock_enable;
168 168 int32_t sync_enable;
169 169 int32_t secmode;
170 170 int32_t netbios_enable;
171 171 int32_t ipv6_enable;
172 172 int32_t print_enable;
173 173 int32_t traverse_mounts;
174 174 uint32_t max_protocol;
175 + uint32_t min_protocol;
176 + uint32_t encrypt;
175 177 uint32_t exec_flags;
176 178 uint32_t negtok_len;
177 179 smb_version_t version;
178 180 uint16_t initial_credits;
179 181 uint16_t maximum_credits;
180 182 /* SMB negotiate protocol response. */
181 183 uuid_t machine_uuid;
182 184 uchar_t negtok[SMB_PI_MAX_NEGTOK];
183 185 char native_os[SMB_PI_MAX_NATIVE_OS];
184 186 char native_lm[SMB_PI_MAX_LANMAN];
185 187 char nbdomain[NETBIOS_NAME_SZ];
186 188 char fqdn[SMB_PI_MAX_DOMAIN];
187 189 char hostname[SMB_PI_MAX_HOST];
188 190 char system_comment[SMB_PI_MAX_COMMENT];
189 191 } smb_ioc_cfg_t;
190 192
191 193 typedef union smb_ioc {
192 194 smb_ioc_header_t ioc_hdr;
193 195 smb_ioc_gmt_t ioc_gmt;
194 196 smb_ioc_cfg_t ioc_cfg;
195 197 smb_ioc_start_t ioc_start;
196 198 smb_ioc_event_t ioc_event;
197 199 smb_ioc_opennum_t ioc_opennum;
198 200 smb_ioc_svcenum_t ioc_svcenum;
199 201 smb_ioc_session_t ioc_session;
200 202 smb_ioc_fileid_t ioc_fileid;
201 203 smb_ioc_share_t ioc_share;
202 204 smb_ioc_shareinfo_t ioc_shareinfo;
203 205 smb_ioc_spooldoc_t ioc_spooldoc;
204 206 } smb_ioc_t;
205 207
206 208 uint32_t smb_crc_gen(uint8_t *, size_t);
207 209
208 210 /* fksmbd (init,open,close,ioctl) calls into libfksmbsrv */
209 211 int fksmbsrv_drv_open(void);
210 212 int fksmbsrv_drv_close(void);
211 213 int fksmbsrv_drv_ioctl(int cmd, void *arg);
212 214 void fksmbsrv_drv_load(void);
213 215
214 216 #ifdef __cplusplus
215 217 }
216 218 #endif
217 219
218 220 #endif /* _SMB_IOCTL_H_ */
|
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX