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) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
24 * Copyright 2017 Joyent, Inc.
25 */
26
27 #include <sys/types.h>
28 #include <sys/stat.h>
29 #include <sys/ioccom.h>
30 #include <sys/param.h>
31 #include <stddef.h>
32 #include <stdio.h>
33 #include <string.h>
34 #include <strings.h>
35 #include <stdlib.h>
36 #include <unistd.h>
37 #include <fcntl.h>
38 #include <errno.h>
39
40 #include <smbsrv/smb_xdr.h>
41 #include <smbsrv/smbinfo.h>
42 #include <smbsrv/smb_ioctl.h>
43 #include <smbsrv/libsmb.h>
44
79 ioc.maxconnections = cfg->skc_maxconnections;
80 ioc.keepalive = cfg->skc_keepalive;
81 ioc.restrict_anon = cfg->skc_restrict_anon;
82 ioc.signing_enable = cfg->skc_signing_enable;
83 ioc.signing_required = cfg->skc_signing_required;
84 ioc.oplock_enable = cfg->skc_oplock_enable;
85 ioc.sync_enable = cfg->skc_sync_enable;
86 ioc.secmode = cfg->skc_secmode;
87 ioc.netbios_enable = cfg->skc_netbios_enable;
88 ioc.ipv6_enable = cfg->skc_ipv6_enable;
89 ioc.print_enable = cfg->skc_print_enable;
90 ioc.traverse_mounts = cfg->skc_traverse_mounts;
91 ioc.max_protocol = cfg->skc_max_protocol;
92 ioc.min_protocol = cfg->skc_min_protocol;
93 ioc.exec_flags = cfg->skc_execflags;
94 ioc.negtok_len = cfg->skc_negtok_len;
95 ioc.version = cfg->skc_version;
96 ioc.initial_credits = cfg->skc_initial_credits;
97 ioc.maximum_credits = cfg->skc_maximum_credits;
98 ioc.encrypt = cfg->skc_encrypt;
99
100 (void) memcpy(ioc.machine_uuid, cfg->skc_machine_uuid, sizeof (uuid_t));
101 (void) memcpy(ioc.negtok, cfg->skc_negtok, sizeof (ioc.negtok));
102 (void) memcpy(ioc.native_os, cfg->skc_native_os,
103 sizeof (ioc.native_os));
104 (void) memcpy(ioc.native_lm, cfg->skc_native_lm,
105 sizeof (ioc.native_lm));
106
107 (void) strlcpy(ioc.nbdomain, cfg->skc_nbdomain, sizeof (ioc.nbdomain));
108 (void) strlcpy(ioc.fqdn, cfg->skc_fqdn, sizeof (ioc.fqdn));
109 (void) strlcpy(ioc.hostname, cfg->skc_hostname, sizeof (ioc.hostname));
110 (void) strlcpy(ioc.system_comment, cfg->skc_system_comment,
111 sizeof (ioc.system_comment));
112
113 return (smb_kmod_ioctl(SMB_IOC_CONFIG, &ioc.hdr, sizeof (ioc)));
114 }
115
116 int
117 smb_kmod_setgmtoff(int32_t gmtoff)
118 {
|
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) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
24 * Copyright 2017 Joyent, Inc.
25 * Copyright 2020 RackTop Systems, Inc.
26 */
27
28 #include <sys/types.h>
29 #include <sys/stat.h>
30 #include <sys/ioccom.h>
31 #include <sys/param.h>
32 #include <stddef.h>
33 #include <stdio.h>
34 #include <string.h>
35 #include <strings.h>
36 #include <stdlib.h>
37 #include <unistd.h>
38 #include <fcntl.h>
39 #include <errno.h>
40
41 #include <smbsrv/smb_xdr.h>
42 #include <smbsrv/smbinfo.h>
43 #include <smbsrv/smb_ioctl.h>
44 #include <smbsrv/libsmb.h>
45
80 ioc.maxconnections = cfg->skc_maxconnections;
81 ioc.keepalive = cfg->skc_keepalive;
82 ioc.restrict_anon = cfg->skc_restrict_anon;
83 ioc.signing_enable = cfg->skc_signing_enable;
84 ioc.signing_required = cfg->skc_signing_required;
85 ioc.oplock_enable = cfg->skc_oplock_enable;
86 ioc.sync_enable = cfg->skc_sync_enable;
87 ioc.secmode = cfg->skc_secmode;
88 ioc.netbios_enable = cfg->skc_netbios_enable;
89 ioc.ipv6_enable = cfg->skc_ipv6_enable;
90 ioc.print_enable = cfg->skc_print_enable;
91 ioc.traverse_mounts = cfg->skc_traverse_mounts;
92 ioc.max_protocol = cfg->skc_max_protocol;
93 ioc.min_protocol = cfg->skc_min_protocol;
94 ioc.exec_flags = cfg->skc_execflags;
95 ioc.negtok_len = cfg->skc_negtok_len;
96 ioc.version = cfg->skc_version;
97 ioc.initial_credits = cfg->skc_initial_credits;
98 ioc.maximum_credits = cfg->skc_maximum_credits;
99 ioc.encrypt = cfg->skc_encrypt;
100 ioc.encrypt_cipher = cfg->skc_encrypt_cipher;
101
102 (void) memcpy(ioc.machine_uuid, cfg->skc_machine_uuid, sizeof (uuid_t));
103 (void) memcpy(ioc.negtok, cfg->skc_negtok, sizeof (ioc.negtok));
104 (void) memcpy(ioc.native_os, cfg->skc_native_os,
105 sizeof (ioc.native_os));
106 (void) memcpy(ioc.native_lm, cfg->skc_native_lm,
107 sizeof (ioc.native_lm));
108
109 (void) strlcpy(ioc.nbdomain, cfg->skc_nbdomain, sizeof (ioc.nbdomain));
110 (void) strlcpy(ioc.fqdn, cfg->skc_fqdn, sizeof (ioc.fqdn));
111 (void) strlcpy(ioc.hostname, cfg->skc_hostname, sizeof (ioc.hostname));
112 (void) strlcpy(ioc.system_comment, cfg->skc_system_comment,
113 sizeof (ioc.system_comment));
114
115 return (smb_kmod_ioctl(SMB_IOC_CONFIG, &ioc.hdr, sizeof (ioc)));
116 }
117
118 int
119 smb_kmod_setgmtoff(int32_t gmtoff)
120 {
|