Print this page
12513 SMB 3.1.1 support for server


   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>


 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);




   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  * Copyright 2020 RackTop Systems, Inc.
  25  */
  26 
  27 #include <sys/types.h>
  28 #include <sys/sockio.h>
  29 #include <sys/socket.h>
  30 #include <sys/utsname.h>
  31 
  32 #include <stdarg.h>
  33 #include <unistd.h>
  34 #include <stdlib.h>
  35 #include <time.h>
  36 #include <synch.h>
  37 #include <syslog.h>
  38 #include <string.h>
  39 #include <strings.h>
  40 #include <errno.h>
  41 #include <net/if.h>
  42 #include <netdb.h>
  43 #include <netinet/in.h>
  44 #include <arpa/nameser.h>


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