Print this page
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-4598 SMB2 credit shortage with Mac client
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Matt Barden <Matt.Barden@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-2314 SMB server debug logging needs improvement
NEX-1810 extended security Kerberos (inbound)
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-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


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 
  26 #include <sys/types.h>
  27 #include <sys/sockio.h>
  28 #include <sys/socket.h>
  29 #include <sys/utsname.h>
  30 
  31 #include <stdarg.h>
  32 #include <unistd.h>
  33 #include <stdlib.h>
  34 #include <time.h>
  35 #include <synch.h>
  36 #include <syslog.h>
  37 #include <string.h>
  38 #include <strings.h>
  39 #include <errno.h>
  40 #include <net/if.h>
  41 #include <netdb.h>
  42 #include <netinet/in.h>
  43 #include <arpa/nameser.h>


 140                 kcfg->skc_maxworkers = kcfg->skc_maximum_credits;
 141 
 142         (void) smb_config_getnum(SMB_CI_KEEPALIVE, &citem);
 143         kcfg->skc_keepalive = (uint32_t)citem;
 144         if ((kcfg->skc_keepalive != 0) &&
 145             (kcfg->skc_keepalive < SMB_PI_KEEP_ALIVE_MIN))
 146                 kcfg->skc_keepalive = SMB_PI_KEEP_ALIVE_MIN;
 147 
 148         (void) smb_config_getnum(SMB_CI_MAX_CONNECTIONS, &citem);
 149         kcfg->skc_maxconnections = (uint32_t)citem;
 150         kcfg->skc_restrict_anon = smb_config_getbool(SMB_CI_RESTRICT_ANON);
 151         kcfg->skc_signing_enable = smb_config_getbool(SMB_CI_SIGNING_ENABLE);
 152         kcfg->skc_signing_required = smb_config_getbool(SMB_CI_SIGNING_REQD);
 153         kcfg->skc_netbios_enable = smb_config_getbool(SMB_CI_NETBIOS_ENABLE);
 154         kcfg->skc_ipv6_enable = smb_config_getbool(SMB_CI_IPV6_ENABLE);
 155         kcfg->skc_print_enable = smb_config_getbool(SMB_CI_PRINT_ENABLE);
 156         kcfg->skc_oplock_enable = smb_config_getbool(SMB_CI_OPLOCK_ENABLE);
 157         kcfg->skc_sync_enable = smb_config_getbool(SMB_CI_SYNC_ENABLE);
 158         kcfg->skc_traverse_mounts = smb_config_getbool(SMB_CI_TRAVERSE_MOUNTS);
 159         kcfg->skc_max_protocol = smb_config_get_max_protocol();

 160         kcfg->skc_secmode = smb_config_get_secmode();

 161 
 162         (void) smb_getdomainname(kcfg->skc_nbdomain,
 163             sizeof (kcfg->skc_nbdomain));
 164         (void) smb_getfqdomainname(kcfg->skc_fqdn,
 165             sizeof (kcfg->skc_fqdn));
 166         (void) smb_getnetbiosname(kcfg->skc_hostname,
 167             sizeof (kcfg->skc_hostname));
 168         (void) smb_config_getstr(SMB_CI_SYS_CMNT, kcfg->skc_system_comment,
 169             sizeof (kcfg->skc_system_comment));
 170         smb_config_get_version(&kcfg->skc_version);
 171         kcfg->skc_execflags = smb_config_get_execinfo(NULL, NULL, 0);
 172         if (smb_config_get_localuuid(kcfg->skc_machine_uuid) < 0) {
 173                 syslog(LOG_ERR, "smb_load_kconfig: no machine_uuid");
 174                 uuid_generate_time(kcfg->skc_machine_uuid);
 175         }
 176         /* skc_negtok, skc_negtok_len: see smbd_authsvc.c */
 177 
 178         (void) uname(&uts);
 179         (void) snprintf(kcfg->skc_native_os, sizeof (kcfg->skc_native_os),
 180             "%s %s %s", uts.sysname, uts.release, uts.version);




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 
  26 #include <sys/types.h>
  27 #include <sys/sockio.h>
  28 #include <sys/socket.h>
  29 #include <sys/utsname.h>
  30 
  31 #include <stdarg.h>
  32 #include <unistd.h>
  33 #include <stdlib.h>
  34 #include <time.h>
  35 #include <synch.h>
  36 #include <syslog.h>
  37 #include <string.h>
  38 #include <strings.h>
  39 #include <errno.h>
  40 #include <net/if.h>
  41 #include <netdb.h>
  42 #include <netinet/in.h>
  43 #include <arpa/nameser.h>


 140                 kcfg->skc_maxworkers = kcfg->skc_maximum_credits;
 141 
 142         (void) smb_config_getnum(SMB_CI_KEEPALIVE, &citem);
 143         kcfg->skc_keepalive = (uint32_t)citem;
 144         if ((kcfg->skc_keepalive != 0) &&
 145             (kcfg->skc_keepalive < SMB_PI_KEEP_ALIVE_MIN))
 146                 kcfg->skc_keepalive = SMB_PI_KEEP_ALIVE_MIN;
 147 
 148         (void) smb_config_getnum(SMB_CI_MAX_CONNECTIONS, &citem);
 149         kcfg->skc_maxconnections = (uint32_t)citem;
 150         kcfg->skc_restrict_anon = smb_config_getbool(SMB_CI_RESTRICT_ANON);
 151         kcfg->skc_signing_enable = smb_config_getbool(SMB_CI_SIGNING_ENABLE);
 152         kcfg->skc_signing_required = smb_config_getbool(SMB_CI_SIGNING_REQD);
 153         kcfg->skc_netbios_enable = smb_config_getbool(SMB_CI_NETBIOS_ENABLE);
 154         kcfg->skc_ipv6_enable = smb_config_getbool(SMB_CI_IPV6_ENABLE);
 155         kcfg->skc_print_enable = smb_config_getbool(SMB_CI_PRINT_ENABLE);
 156         kcfg->skc_oplock_enable = smb_config_getbool(SMB_CI_OPLOCK_ENABLE);
 157         kcfg->skc_sync_enable = smb_config_getbool(SMB_CI_SYNC_ENABLE);
 158         kcfg->skc_traverse_mounts = smb_config_getbool(SMB_CI_TRAVERSE_MOUNTS);
 159         kcfg->skc_max_protocol = smb_config_get_max_protocol();
 160         kcfg->skc_min_protocol = smb_config_get_min_protocol();
 161         kcfg->skc_secmode = smb_config_get_secmode();
 162         kcfg->skc_encrypt = smb_config_get_require(SMB_CI_ENCRYPT);
 163 
 164         (void) smb_getdomainname(kcfg->skc_nbdomain,
 165             sizeof (kcfg->skc_nbdomain));
 166         (void) smb_getfqdomainname(kcfg->skc_fqdn,
 167             sizeof (kcfg->skc_fqdn));
 168         (void) smb_getnetbiosname(kcfg->skc_hostname,
 169             sizeof (kcfg->skc_hostname));
 170         (void) smb_config_getstr(SMB_CI_SYS_CMNT, kcfg->skc_system_comment,
 171             sizeof (kcfg->skc_system_comment));
 172         smb_config_get_version(&kcfg->skc_version);
 173         kcfg->skc_execflags = smb_config_get_execinfo(NULL, NULL, 0);
 174         if (smb_config_get_localuuid(kcfg->skc_machine_uuid) < 0) {
 175                 syslog(LOG_ERR, "smb_load_kconfig: no machine_uuid");
 176                 uuid_generate_time(kcfg->skc_machine_uuid);
 177         }
 178         /* skc_negtok, skc_negtok_len: see smbd_authsvc.c */
 179 
 180         (void) uname(&uts);
 181         (void) snprintf(kcfg->skc_native_os, sizeof (kcfg->skc_native_os),
 182             "%s %s %s", uts.sysname, uts.release, uts.version);