annotate usr/src/lib/smbsrv/libsmb/common/libsmb.h @ 10717:fe0545fc3cdd

6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API 6877755 smbd should not route stderr, stdout to /dev/null 6882701 Wrong error message for attempt to map local user to Windows group, or vice versa 6885105 Potential for deadlock in smb_node_set_delete_on_close() 6881928 smbd core generated when running a script to join domain, set abe properties 6885538 Reduce dependencies on libsmbrdr 6820325 cifs service can't start on multi vlan+ipmp configuration
author Alan Wright <amw@Sun.COM>
date Mon, 05 Oct 2009 11:03:34 -0700
parents 96eda55bfd54
children 37e5dcdf36d3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
1 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
2 * CDDL HEADER START
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
3 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
5 * Common Development and Distribution License (the "License").
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
6 * You may not use this file except in compliance with the License.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
7 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
10 * See the License for the specific language governing permissions
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
11 * and limitations under the License.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
12 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
18 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
19 * CDDL HEADER END
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
20 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
21 /*
8474
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
23 * Use is subject to license terms.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
24 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
25
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
26 #ifndef _LIBSMB_H
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
27 #define _LIBSMB_H
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
28
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
29 #ifdef __cplusplus
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
30 extern "C" {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
31 #endif
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
32
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
33 #include <sys/types.h>
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
34 #include <sys/list.h>
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
35 #include <arpa/inet.h>
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
36 #include <net/if.h>
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
37 #include <inet/tcp.h>
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
38 #include <uuid/uuid.h>
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
39 #include <netdb.h>
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
40 #include <stdlib.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
41 #include <libscf.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
42 #include <libshare.h>
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
43 #include <sqlite/sqlite.h>
10122
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
44 #include <uuid/uuid.h>
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
45
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
46 #include <smbsrv/string.h>
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
47 #include <smbsrv/smb_idmap.h>
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
48 #include <smbsrv/netbios.h>
7052
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
49 #include <smbsrv/smb_share.h>
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
50 #include <smbsrv/ntstatus.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
51 #include <smbsrv/smb_door_svc.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
52 #include <smbsrv/alloc.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
53 #include <smbsrv/codepage.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
54 #include <smbsrv/ctype.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
55 #include <smbsrv/hash_table.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
56 #include <smbsrv/msgbuf.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
57 #include <smbsrv/oem.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
58 #include <smbsrv/smb_i18n.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
59 #include <smbsrv/wintypes.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
60 #include <smbsrv/smb_xdr.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
61 #include <smbsrv/smbinfo.h>
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
62 #include <smbsrv/ntifs.h>
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
63
6139
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
64 #define SMB_VARRUN_DIR "/var/run/smb"
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
65 #define SMB_CCACHE_FILE "ccache"
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
66 #define SMB_CCACHE_PATH SMB_VARRUN_DIR "/" SMB_CCACHE_FILE
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
67
8334
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
68
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
69 /* Max value length of all SMB properties */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
70 #define MAX_VALUE_BUFLEN 512
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
71
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
72 #define SMBD_FMRI_PREFIX "network/smb/server"
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
73 #define SMBD_DEFAULT_INSTANCE_FMRI "svc:/network/smb/server:default"
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
74 #define SMBD_PG_NAME "smbd"
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
75 #define SMBD_PROTECTED_PG_NAME "read"
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
76 #define SMBD_EXEC_PG_NAME "exec"
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
77
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
78 #define SMBD_SMF_OK 0
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
79 #define SMBD_SMF_NO_MEMORY 1 /* no memory for data structures */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
80 #define SMBD_SMF_SYSTEM_ERR 2 /* system error, use errno */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
81 #define SMBD_SMF_NO_PERMISSION 3 /* no permission for operation */
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
82 #define SMBD_SMF_INVALID_ARG 4
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
83
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
84 #define SCH_STATE_UNINIT 0
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
85 #define SCH_STATE_INITIALIZING 1
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
86 #define SCH_STATE_INIT 2
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
87
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
88 typedef struct smb_scfhandle {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
89 scf_handle_t *scf_handle;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
90 int scf_state;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
91 scf_service_t *scf_service;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
92 scf_scope_t *scf_scope;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
93 scf_transaction_t *scf_trans;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
94 scf_transaction_entry_t *scf_entry;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
95 scf_propertygroup_t *scf_pg;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
96 scf_instance_t *scf_instance;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
97 scf_iter_t *scf_inst_iter;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
98 scf_iter_t *scf_pg_iter;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
99 } smb_scfhandle_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
100
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
101 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
102 * CIFS Configuration Management
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
103 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
104 typedef enum {
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
105 SMB_CI_OPLOCK_ENABLE = 0,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
106
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
107 SMB_CI_AUTOHOME_MAP,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
108
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
109 SMB_CI_DOMAIN_SID,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
110 SMB_CI_DOMAIN_MEMB,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
111 SMB_CI_DOMAIN_NAME,
8334
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
112 SMB_CI_DOMAIN_FQDN,
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
113 SMB_CI_DOMAIN_FOREST,
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
114 SMB_CI_DOMAIN_GUID,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
115 SMB_CI_DOMAIN_SRV,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
116
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
117 SMB_CI_WINS_SRV1,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
118 SMB_CI_WINS_SRV2,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
119 SMB_CI_WINS_EXCL,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
120
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
121 SMB_CI_MAX_WORKERS,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
122 SMB_CI_MAX_CONNECTIONS,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
123 SMB_CI_KEEPALIVE,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
124 SMB_CI_RESTRICT_ANON,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
125
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
126 SMB_CI_SIGNING_ENABLE,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
127 SMB_CI_SIGNING_REQD,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
128
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
129 SMB_CI_SYNC_ENABLE,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
130
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
131 SMB_CI_SECURITY,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
132 SMB_CI_NBSCOPE,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
133 SMB_CI_SYS_CMNT,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
134 SMB_CI_LM_LEVEL,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
135
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
136 SMB_CI_ADS_SITE,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
137
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
138 SMB_CI_DYNDNS_ENABLE,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
139
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
140 SMB_CI_MACHINE_PASSWD,
6139
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
141 SMB_CI_KPASSWD_SRV,
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
142 SMB_CI_KPASSWD_DOMAIN,
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
143 SMB_CI_KPASSWD_SEQNUM,
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
144 SMB_CI_NETLOGON_SEQNUM,
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
145 SMB_CI_IPV6_ENABLE,
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
146 SMB_CI_MAP,
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
147 SMB_CI_UNMAP,
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
148 SMB_CI_DISPOSITION,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
149 SMB_CI_MAX
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
150 } smb_cfg_id_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
151
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
152 /* SMF helper functions */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
153 extern smb_scfhandle_t *smb_smf_scf_init(char *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
154 extern void smb_smf_scf_fini(smb_scfhandle_t *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
155 extern int smb_smf_start_transaction(smb_scfhandle_t *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
156 extern int smb_smf_end_transaction(smb_scfhandle_t *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
157 extern int smb_smf_set_string_property(smb_scfhandle_t *, char *, char *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
158 extern int smb_smf_get_string_property(smb_scfhandle_t *, char *,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
159 char *, size_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
160 extern int smb_smf_set_integer_property(smb_scfhandle_t *, char *, int64_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
161 extern int smb_smf_get_integer_property(smb_scfhandle_t *, char *, int64_t *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
162 extern int smb_smf_set_boolean_property(smb_scfhandle_t *, char *, uint8_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
163 extern int smb_smf_get_boolean_property(smb_scfhandle_t *, char *, uint8_t *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
164 extern int smb_smf_set_opaque_property(smb_scfhandle_t *, char *,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
165 void *, size_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
166 extern int smb_smf_get_opaque_property(smb_scfhandle_t *, char *,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
167 void *, size_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
168 extern int smb_smf_create_service_pgroup(smb_scfhandle_t *, char *);
7348
73b61202d5d6 6584155 Confusing 'No such object' message is logged when a share is successfully published.
jose borrego <Jose.Borrego@Sun.COM>
parents: 7052
diff changeset
169 extern int smb_smf_restart_service(void);
8334
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
170 extern int smb_smf_maintenance_mode(void);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
171
8871
1352ad8492a7 6804285 Snapshots are not visible from Windows Clients as Volume Shadow Copies
Alan Wright <amw@Sun.COM>
parents: 8670
diff changeset
172 /* ZFS interface */
1352ad8492a7 6804285 Snapshots are not visible from Windows Clients as Volume Shadow Copies
Alan Wright <amw@Sun.COM>
parents: 8670
diff changeset
173 int smb_getdataset(const char *, char *, size_t);
1352ad8492a7 6804285 Snapshots are not visible from Windows Clients as Volume Shadow Copies
Alan Wright <amw@Sun.COM>
parents: 8670
diff changeset
174
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
175 /* Configuration management functions */
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
176 extern int smb_config_get(smb_cfg_id_t, char *, int);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
177 extern char *smb_config_getname(smb_cfg_id_t);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
178 extern int smb_config_getstr(smb_cfg_id_t, char *, int);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
179 extern int smb_config_getnum(smb_cfg_id_t, int64_t *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
180 extern boolean_t smb_config_getbool(smb_cfg_id_t);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
181
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
182 extern int smb_config_set(smb_cfg_id_t, char *);
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
183 extern int smb_config_setstr(smb_cfg_id_t, char *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
184 extern int smb_config_setnum(smb_cfg_id_t, int64_t);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
185 extern int smb_config_setbool(smb_cfg_id_t, boolean_t);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
186
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
187 extern uint8_t smb_config_get_fg_flag(void);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
188 extern char *smb_config_get_localsid(void);
6139
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
189 extern int smb_config_secmode_fromstr(char *);
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
190 extern char *smb_config_secmode_tostr(int);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
191 extern int smb_config_get_secmode(void);
6139
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
192 extern int smb_config_set_secmode(int);
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
193 extern int smb_config_set_idmap_domain(char *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
194 extern int smb_config_refresh_idmap(void);
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
195 extern int smb_config_getip(smb_cfg_id_t, smb_inaddr_t *);
8334
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
196
6771
2e6e486314b6 6686467 Panic in smb_trans_net_share_enum() while browsing over 200 shares from Mac
jb150015
parents: 6600
diff changeset
197 extern void smb_load_kconfig(smb_kmod_cfg_t *kcfg);
8167
6daa56c3d019 6772644 Arbitrary arguments passed to smbsrv routines may lead to unintended behavior
Alan Wright <amw@Sun.COM>
parents: 7961
diff changeset
198 extern uint32_t smb_crc_gen(uint8_t *, size_t);
6771
2e6e486314b6 6686467 Panic in smb_trans_net_share_enum() while browsing over 200 shares from Mac
jb150015
parents: 6600
diff changeset
199
6139
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
200 extern boolean_t smb_match_netlogon_seqnum(void);
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
201 extern int smb_setdomainprops(char *, char *, char *);
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
202 extern void smb_update_netlogon_seqnum(void);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
203
7961
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
204 /* maximum password length on Windows 2000 and above */
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
205 #define SMB_PASSWD_MAXLEN 127
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
206 #define SMB_USERNAME_MAXLEN 40
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
207
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
208 typedef struct smb_joininfo {
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
209 char domain_name[MAXHOSTNAMELEN];
7961
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
210 char domain_username[SMB_USERNAME_MAXLEN + 1];
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
211 char domain_passwd[SMB_PASSWD_MAXLEN + 1];
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
212 uint32_t mode;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
213 } smb_joininfo_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
214
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
215 /* APIs to communicate with SMB daemon via door calls */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
216 extern uint32_t smb_join(smb_joininfo_t *info);
6139
5c743b207bf9 6541120 Configuration is not propagated to SMB kernel module
jb150015
parents: 6030
diff changeset
217 extern bool_t xdr_smb_dr_joininfo_t(XDR *, smb_joininfo_t *);
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
218 extern boolean_t smb_find_ads_server(char *, char *, int);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
219
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
220 extern void smb_config_getdomaininfo(char *, char *, char *, char *, char *);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
221 extern void smb_config_setdomaininfo(char *, char *, char *, char *, char *);
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
222 extern uint32_t smb_get_dcinfo(char *, uint32_t, smb_inaddr_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
223
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
224 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
225 * buffer context structure. This is used to keep track of the buffer
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
226 * context.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
227 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
228 * basep: points to the beginning of the buffer
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
229 * curp: points to the current offset
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
230 * endp: points to the limit of the buffer
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
231 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
232 typedef struct {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
233 unsigned char *basep;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
234 unsigned char *curp;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
235 unsigned char *endp;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
236 } smb_ctxbuf_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
237
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
238 extern int smb_ctxbuf_init(smb_ctxbuf_t *ctx, unsigned char *buf,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
239 size_t buflen);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
240 extern int smb_ctxbuf_len(smb_ctxbuf_t *ctx);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
241 extern int smb_ctxbuf_printf(smb_ctxbuf_t *ctx, const char *fmt, ...);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
242
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
243 /* Functions to handle SMB daemon communications with idmap service */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
244 extern int smb_idmap_start(void);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
245 extern void smb_idmap_stop(void);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
246 extern int smb_idmap_restart(void);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
247
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
248 /* Miscellaneous functions */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
249 extern void hexdump(unsigned char *, int);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
250 extern size_t bintohex(const char *, size_t, char *, size_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
251 extern size_t hextobin(const char *, size_t, char *, size_t);
8334
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
252 extern char *strstrip(char *, const char *);
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
253 extern char *strtrim(char *, const char *);
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
254 extern char *trim_whitespace(char *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
255 extern void randomize(char *, unsigned);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
256 extern void rand_hash(unsigned char *, size_t, unsigned char *, size_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
257
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
258 extern int smb_getdomainname(char *, size_t);
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
259 extern int smb_getfqdomainname(char *, size_t);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
260 extern int smb_gethostname(char *, size_t, int);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
261 extern int smb_getfqhostname(char *, size_t);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
262 extern int smb_getnetbiosname(char *, size_t);
8334
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
263 extern struct hostent *smb_gethostbyname(const char *, int *);
5f1c6a3b0fad 6762162 $DATA appended to streams when stream type != $DATA
jose borrego <Jose.Borrego@Sun.COM>
parents: 8167
diff changeset
264 extern struct hostent *smb_gethostbyaddr(const char *, int, int, int *);
7961
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
265
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
266 #define SMB_SAMACCT_MAXLEN (NETBIOS_NAME_SZ + 1)
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
267 extern int smb_getsamaccount(char *, size_t);
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 7588
diff changeset
268
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
269 extern int smb_get_nameservers(smb_inaddr_t *, int);
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
270 extern void smb_tonetbiosname(char *, char *, char);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
271
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
272 extern int smb_chk_hostaccess(smb_inaddr_t *, char *);
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
273
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
274 extern int smb_getnameinfo(smb_inaddr_t *, char *, int, int);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
275
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
276 void smb_trace(const char *s);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
277 void smb_tracef(const char *fmt, ...);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
278
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
279 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
280 * Authentication
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
281 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
282
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
283 #define SMBAUTH_LM_MAGIC_STR "KGS!@#$%"
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
284
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
285 #define SMBAUTH_HASH_SZ 16 /* also LM/NTLM/NTLMv2 Hash size */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
286 #define SMBAUTH_LM_RESP_SZ 24 /* also NTLM Response size */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
287 #define SMBAUTH_LM_PWD_SZ 14 /* LM password size */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
288 #define SMBAUTH_V2_CLNT_CHALLENGE_SZ 8 /* both LMv2 and NTLMv2 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
289 #define SMBAUTH_SESSION_KEY_SZ SMBAUTH_HASH_SZ
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
290 #define SMBAUTH_HEXHASH_SZ (SMBAUTH_HASH_SZ * 2)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
291
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
292 #define SMBAUTH_FAILURE 1
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
293 #define SMBAUTH_SUCCESS 0
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
294 #define MD_DIGEST_LEN 16
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
295
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
296 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
297 * Name Types
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
298 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
299 * The list of names near the end of the data blob (i.e. the ndb_names
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
300 * field of the smb_auth_data_blob_t data structure) can be classify into
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
301 * the following types:
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
302 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
303 * 0x0000 Indicates the end of the list.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
304 * 0x0001 The name is a NetBIOS machine name (e.g. server name)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
305 * 0x0002 The name is an NT Domain NetBIOS name.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
306 * 0x0003 The name is the server's DNS hostname.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
307 * 0x0004 The name is a W2K Domain name (a DNS name).
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
308 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
309 #define SMBAUTH_NAME_TYPE_LIST_END 0x0000
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
310 #define SMBAUTH_NAME_TYPE_SERVER_NETBIOS 0x0001
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
311 #define SMBAUTH_NAME_TYPE_DOMAIN_NETBIOS 0x0002
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
312 #define SMBAUTH_NAME_TYPE_SERVER_DNS 0x0003
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
313 #define SMBAUTH_NAME_TYPE_DOMAIN_DNS 0x0004
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
314
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
315 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
316 * smb_auth_name_entry_t
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
317 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
318 * Each name entry in the data blob consists of the following 3 fields:
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
319 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
320 * nne_type - name type
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
321 * nne_len - the length of the name
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
322 * nne_name - the name, in uppercase UCS-2LE Unicode format
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
323 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
324 typedef struct smb_auth_name_entry {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
325 unsigned short nne_type;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
326 unsigned short nne_len;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
327 mts_wchar_t nne_name[SMB_PI_MAX_DOMAIN * 2];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
328 } smb_auth_name_entry_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
329
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
330 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
331 * smb_auth_data_blob
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
332 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
333 * The format of this NTLMv2 data blob structure is as follow:
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
334 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
335 * - Blob Signature 0x01010000 (4 bytes)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
336 * - Reserved (0x00000000) (4 bytes)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
337 * - Timestamp Little-endian, 64-bit signed value representing
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
338 * the number of tenths of a microsecond since January 1, 1601.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
339 * (8 bytes)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
340 * - Client Challenge (8 bytes)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
341 * - Unknown1 (4 bytes)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
342 * - List of Target Information (variable length)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
343 * - Unknown2 (4 bytes)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
344 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
345 typedef struct smb_auth_data_blob {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
346 unsigned char ndb_signature[4];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
347 unsigned char ndb_reserved[4];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
348 uint64_t ndb_timestamp;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
349 unsigned char ndb_clnt_challenge[SMBAUTH_V2_CLNT_CHALLENGE_SZ];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
350 unsigned char ndb_unknown[4];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
351 smb_auth_name_entry_t ndb_names[2];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
352 unsigned char ndb_unknown2[4];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
353 } smb_auth_data_blob_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
354
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
355 #define SMBAUTH_BLOB_MAXLEN (sizeof (smb_auth_data_blob_t))
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
356 #define SMBAUTH_CI_MAXLEN SMBAUTH_LM_RESP_SZ
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
357 #define SMBAUTH_CS_MAXLEN (SMBAUTH_BLOB_MAXLEN + SMBAUTH_HASH_SZ)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
358
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
359 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
360 * smb_auth_info_t
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
361 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
362 * The structure contains all the authentication information
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
363 * needed for the preparaton of the SMBSessionSetupAndx request
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
364 * and the user session key.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
365 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
366 * hash - NTLM hash
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
367 * hash_v2 - NTLMv2 hash
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
368 * ci_len - the length of the case-insensitive password
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
369 * ci - case-insensitive password
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
370 * (If NTLMv2 authentication mechanism is used, it
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
371 * represents the LMv2 response. Otherwise, it
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
372 * is empty.)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
373 * cs_len - the length of the case-sensitive password
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
374 * cs - case-sensitive password
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
375 * (If NTLMv2 authentication mechanism is used, it
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
376 * represents the NTLMv2 response. Otherwise, it
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
377 * represents the NTLM response.)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
378 * data_blob - NTLMv2 data blob
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
379 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
380 typedef struct smb_auth_info {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
381 unsigned char hash[SMBAUTH_HASH_SZ];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
382 unsigned char hash_v2[SMBAUTH_HASH_SZ];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
383 unsigned short ci_len;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
384 unsigned char ci[SMBAUTH_CI_MAXLEN];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
385 unsigned short cs_len;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
386 unsigned char cs[SMBAUTH_CS_MAXLEN];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
387 int lmcompatibility_lvl;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
388 smb_auth_data_blob_t data_blob;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
389 } smb_auth_info_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
390
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
391 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
392 * SMB password management
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
393 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
394
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
395 #define SMB_PWF_LM 0x01 /* LM hash is present */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
396 #define SMB_PWF_NT 0x02 /* NT hash is present */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
397 #define SMB_PWF_DISABLE 0x04 /* Account is disabled */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
398
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
399 typedef struct smb_passwd {
8474
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
400 uid_t pw_uid;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
401 uint32_t pw_flags;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
402 char pw_name[SMB_USERNAME_MAXLEN];
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
403 uint8_t pw_lmhash[SMBAUTH_HASH_SZ];
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
404 uint8_t pw_nthash[SMBAUTH_HASH_SZ];
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
405 } smb_passwd_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
406
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
407 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
408 * Control flags passed to smb_pwd_setcntl
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
409 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
410 #define SMB_PWC_DISABLE 0x01
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
411 #define SMB_PWC_ENABLE 0x02
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
412 #define SMB_PWC_NOLM 0x04
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
413
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
414 #define SMB_PWE_SUCCESS 0
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
415 #define SMB_PWE_USER_UNKNOWN 1
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
416 #define SMB_PWE_USER_DISABLE 2
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
417 #define SMB_PWE_CLOSE_FAILED 3
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
418 #define SMB_PWE_OPEN_FAILED 4
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
419 #define SMB_PWE_WRITE_FAILED 6
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
420 #define SMB_PWE_UPDATE_FAILED 7
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
421 #define SMB_PWE_STAT_FAILED 8
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
422 #define SMB_PWE_BUSY 9
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
423 #define SMB_PWE_DENIED 10
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
424 #define SMB_PWE_SYSTEM_ERROR 11
7052
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
425 #define SMB_PWE_INVALID_PARAM 12
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
426 #define SMB_PWE_NO_MEMORY 13
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
427 #define SMB_PWE_MAX 14
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
428
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
429 typedef struct smb_pwditer {
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
430 void *spi_next;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
431 } smb_pwditer_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
432
7052
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
433 typedef struct smb_luser {
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
434 char *su_name;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
435 char *su_fullname;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
436 char *su_desc;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
437 uint32_t su_rid;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
438 uint32_t su_ctrl;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
439 } smb_luser_t;
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
440
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
441 extern void smb_pwd_init(boolean_t);
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
442 extern void smb_pwd_fini(void);
8474
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
443 extern smb_passwd_t *smb_pwd_getpwnam(const char *, smb_passwd_t *);
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
444 extern smb_passwd_t *smb_pwd_getpwuid(uid_t, smb_passwd_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
445 extern int smb_pwd_setpasswd(const char *, const char *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
446 extern int smb_pwd_setcntl(const char *, int);
7052
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
447
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
448 extern int smb_pwd_iteropen(smb_pwditer_t *);
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
449 extern smb_luser_t *smb_pwd_iterate(smb_pwditer_t *);
efa04b030974 6615409 Rename appropriate structures in userland
amw
parents: 6771
diff changeset
450 extern void smb_pwd_iterclose(smb_pwditer_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
451
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
452 extern int smb_auth_qnd_unicode(mts_wchar_t *, const char *, int);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
453 extern int smb_auth_hmac_md5(unsigned char *, int, unsigned char *, int,
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
454 unsigned char *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
455
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
456 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
457 * A variation on HMAC-MD5 known as HMACT64 is used by Windows systems.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
458 * The HMACT64() function is the same as the HMAC-MD5() except that
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
459 * it truncates the input key to 64 bytes rather than hashing it down
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
460 * to 16 bytes using the MD5() function.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
461 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
462 #define SMBAUTH_HMACT64(D, Ds, K, Ks, digest) \
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
463 smb_auth_hmac_md5(D, Ds, K, (Ks > 64) ? 64 : Ks, digest)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
464
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
465 extern int smb_auth_DES(unsigned char *, int, unsigned char *, int,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
466 unsigned char *, int);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
467
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
468 extern int smb_auth_md4(unsigned char *, unsigned char *, int);
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
469 extern int smb_auth_lm_hash(const char *, unsigned char *);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
470 extern int smb_auth_ntlm_hash(const char *, unsigned char *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
471
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
472 extern int smb_auth_set_info(char *, char *,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
473 unsigned char *, char *, unsigned char *,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
474 int, int, smb_auth_info_t *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
475
6600
4e63bcd27ae9 6473755 RFE: Need ability to reconcile oplock and delegation conflicts
as200622
parents: 6432
diff changeset
476 extern int smb_auth_ntlmv2_hash(unsigned char *,
4e63bcd27ae9 6473755 RFE: Need ability to reconcile oplock and delegation conflicts
as200622
parents: 6432
diff changeset
477 char *, char *, unsigned char *);
4e63bcd27ae9 6473755 RFE: Need ability to reconcile oplock and delegation conflicts
as200622
parents: 6432
diff changeset
478
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
479 extern int smb_auth_gen_session_key(smb_auth_info_t *, unsigned char *);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
480
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
481 boolean_t smb_auth_validate_lm(unsigned char *, uint32_t, smb_passwd_t *,
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
482 unsigned char *, int, char *, char *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
483 boolean_t smb_auth_validate_nt(unsigned char *, uint32_t, smb_passwd_t *,
7348
73b61202d5d6 6584155 Confusing 'No such object' message is logged when a share is successfully published.
jose borrego <Jose.Borrego@Sun.COM>
parents: 7052
diff changeset
484 unsigned char *, int, char *, char *, uchar_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
485
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
486 /*
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
487 * SMB authenticated IPC
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
488 */
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
489 extern void smb_ipc_commit(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
490 extern void smb_ipc_get_user(char *, size_t);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
491 extern void smb_ipc_get_passwd(uint8_t *, size_t);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
492 extern void smb_ipc_init(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
493 extern void smb_ipc_rollback(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
494 extern void smb_ipc_set(char *, uint8_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
495
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
496 /*
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
497 * SMB MAC Signing
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
498 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
499
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
500 #define SMB_MAC_KEY_SZ (SMBAUTH_SESSION_KEY_SZ + SMBAUTH_CS_MAXLEN)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
501 #define SMB_SIG_OFFS 14 /* signature field offset within header */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
502 #define SMB_SIG_SIZE 8 /* SMB signature size */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
503
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
504 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
505 * Signing flags:
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
506 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
507 * SMB_SCF_ENABLE Signing is enabled.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
508 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
509 * SMB_SCF_REQUIRED Signing is enabled and required.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
510 * This flag shouldn't be set if
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
511 * SMB_SCF_ENABLE isn't set.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
512 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
513 * SMB_SCF_STARTED Signing will start after receiving
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
514 * the first non-anonymous SessionSetup
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
515 * request.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
516 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
517 * SMB_SCF_KEY_ISSET_THIS_LOGON Indicates whether the MAC key has just
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
518 * been set for this logon. (prior to
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
519 * sending the SMBSessionSetup request)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
520 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
521 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
522 #define SMB_SCF_ENABLE 0x01
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
523 #define SMB_SCF_REQUIRED 0x02
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
524 #define SMB_SCF_STARTED 0x04
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
525 #define SMB_SCF_KEY_ISSET_THIS_LOGON 0x08
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
526
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
527 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
528 * smb_sign_ctx
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
529 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
530 * SMB signing context.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
531 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
532 * ssc_seqnum sequence number
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
533 * ssc_keylen mac key length
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
534 * ssc_mid multiplex id - reserved
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
535 * ssc_flags flags
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
536 * ssc_mackey mac key
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
537 * ssc_sign mac signature
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
538 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
539 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
540 typedef struct smb_sign_ctx {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
541 unsigned int ssc_seqnum;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
542 unsigned short ssc_keylen;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
543 unsigned short ssc_mid;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
544 unsigned int ssc_flags;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
545 unsigned char ssc_mackey[SMB_MAC_KEY_SZ];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
546 unsigned char ssc_sign[SMB_SIG_SIZE];
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
547 } smb_sign_ctx_t;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
548
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
549 extern int smb_mac_init(smb_sign_ctx_t *sign_ctx, smb_auth_info_t *auth);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
550 extern int smb_mac_calc(smb_sign_ctx_t *sign_ctx,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
551 const unsigned char *buf, size_t buf_len, unsigned char *mac_sign);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
552 extern int smb_mac_chk(smb_sign_ctx_t *sign_ctx,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
553 const unsigned char *buf, size_t buf_len);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
554 extern int smb_mac_sign(smb_sign_ctx_t *sign_ctx,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
555 unsigned char *buf, size_t buf_len);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
556 extern void smb_mac_inc_seqnum(smb_sign_ctx_t *sign_ctx);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
557 extern void smb_mac_dec_seqnum(smb_sign_ctx_t *sign_ctx);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
558
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
559 /*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
560 * Each domain is categorized using the enum values below.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
561 * The local domain refers to the local machine and is named
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
562 * after the local hostname. The primary domain is the domain
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
563 * that the system joined. All other domains are either
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
564 * trusted or untrusted, as defined by the primary domain PDC.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
565 */
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
566 typedef enum smb_domain_type {
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
567 SMB_DOMAIN_NULL,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
568 SMB_DOMAIN_BUILTIN,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
569 SMB_DOMAIN_LOCAL,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
570 SMB_DOMAIN_PRIMARY,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
571 SMB_DOMAIN_ACCOUNT,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
572 SMB_DOMAIN_TRUSTED,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
573 SMB_DOMAIN_UNTRUSTED,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
574 SMB_DOMAIN_NUM_TYPES
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
575 } smb_domain_type_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
576
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
577 /*
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
578 * Information specific to trusted domains
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
579 */
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
580 typedef struct smb_domain_trust {
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
581 uint32_t dti_trust_direction;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
582 uint32_t dti_trust_type;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
583 uint32_t dti_trust_attrs;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
584 } smb_domain_trust_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
585
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
586 /*
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
587 * DNS information for domain types that this info is
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
588 * obtained/available. Currently this is only obtained
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
589 * for the primary domain.
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
590 */
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
591 typedef struct smb_domain_dns {
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
592 char ddi_forest[MAXHOSTNAMELEN];
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
593 char ddi_guid[UUID_PRINTABLE_STRING_LENGTH];
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
594 } smb_domain_dns_t;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
595
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
596 /*
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
597 * This is the information that is held about each domain.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
598 */
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
599 typedef struct smb_domain {
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
600 list_node_t di_lnd;
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
601 smb_domain_type_t di_type;
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
602 char di_sid[SMB_SID_STRSZ];
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
603 char di_nbname[NETBIOS_NAME_SZ];
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
604 char di_fqname[MAXHOSTNAMELEN];
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
605 smb_sid_t *di_binsid;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
606 union {
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
607 smb_domain_dns_t di_dns;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
608 smb_domain_trust_t di_trust;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
609 } di_u;
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
610 } smb_domain_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
611
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
612 typedef struct smb_trusted_domains {
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
613 uint32_t td_num;
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
614 smb_domain_t *td_domains;
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
615 } smb_trusted_domains_t;
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
616
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
617 #define SMB_DOMAIN_SUCCESS 0
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
618 #define SMB_DOMAIN_NOMACHINE_SID 1
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
619 #define SMB_DOMAIN_NODOMAIN_SID 2
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
620 #define SMB_DOMAIN_NODOMAIN_NAME 3
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
621 #define SMB_DOMAIN_INTERNAL_ERR 4
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
622 #define SMB_DOMAIN_INVALID_ARG 5
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
623 #define SMB_DOMAIN_NO_MEMORY 6
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
624 #define SMB_DOMAIN_NO_CACHE 7
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
625
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
626 /*
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
627 * This structure could contain information about
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
628 * the primary domain the name of selected domain controller
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
629 * for the primary domain and a list of trusted domains if
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
630 * any. The "ex" in the structure name stands for extended.
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
631 * This is to differentiate this structure from smb_domain_t
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
632 * which only contains information about a single domain.
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
633 */
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
634 typedef struct smb_domainex {
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
635 char d_dc[MAXHOSTNAMELEN];
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
636 smb_domain_t d_primary;
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
637 smb_trusted_domains_t d_trusted;
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
638 } smb_domainex_t;
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
639
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
640 int smb_domain_init(uint32_t);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
641 void smb_domain_fini(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
642 void smb_domain_show(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
643 void smb_domain_save(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
644 boolean_t smb_domain_lookup_name(char *, smb_domain_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
645 boolean_t smb_domain_lookup_sid(smb_sid_t *, smb_domain_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
646 boolean_t smb_domain_lookup_type(smb_domain_type_t, smb_domain_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
647 boolean_t smb_domain_getinfo(smb_domainex_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
648 void smb_domain_update(smb_domainex_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
649 uint32_t smb_domain_start_update(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
650 void smb_domain_end_update(void);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
651 void smb_domain_set_basic_info(char *, char *, char *, smb_domain_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
652 void smb_domain_set_dns_info(char *, char *, char *, char *, char *,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
653 smb_domain_t *);
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
654 void smb_domain_set_trust_info(char *, char *, char *,
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
655 uint32_t, uint32_t, uint32_t, smb_domain_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
656
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
657 typedef enum {
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
658 SMB_LGRP_BUILTIN = 1,
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
659 SMB_LGRP_LOCAL
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
660 } smb_gdomain_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
661
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
662 typedef struct smb_gsid {
6432
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
663 smb_sid_t *gs_sid;
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
664 uint16_t gs_type;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
665 } smb_gsid_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
666
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
667 typedef struct smb_giter {
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
668 sqlite_vm *sgi_vm;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
669 sqlite *sgi_db;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
670 } smb_giter_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
671
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
672 typedef struct smb_group {
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
673 char *sg_name;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
674 char *sg_cmnt;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
675 uint32_t sg_attr;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
676 uint32_t sg_rid;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
677 smb_gsid_t sg_id;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
678 smb_gdomain_t sg_domain;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
679 smb_privset_t *sg_privs;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
680 uint32_t sg_nmembers;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
681 smb_gsid_t *sg_members;
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
682 } smb_group_t;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
683
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
684 int smb_lgrp_start(void);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
685 void smb_lgrp_stop(void);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
686 int smb_lgrp_add(char *, char *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
687 int smb_lgrp_rename(char *, char *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
688 int smb_lgrp_delete(char *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
689 int smb_lgrp_setcmnt(char *, char *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
690 int smb_lgrp_getcmnt(char *, char **);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
691 int smb_lgrp_getpriv(char *, uint8_t, boolean_t *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
692 int smb_lgrp_setpriv(char *, uint8_t, boolean_t);
6432
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
693 int smb_lgrp_add_member(char *, smb_sid_t *, uint16_t);
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
694 int smb_lgrp_del_member(char *, smb_sid_t *, uint16_t);
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
695 int smb_lgrp_getbyname(char *, smb_group_t *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
696 int smb_lgrp_getbyrid(uint32_t, smb_gdomain_t, smb_group_t *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
697 void smb_lgrp_free(smb_group_t *);
6432
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
698 boolean_t smb_lgrp_is_member(smb_group_t *, smb_sid_t *);
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
699 char *smb_lgrp_strerror(int);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
700 int smb_lgrp_iteropen(smb_giter_t *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
701 void smb_lgrp_iterclose(smb_giter_t *);
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
702 int smb_lgrp_iterate(smb_giter_t *, smb_group_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
703
6432
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
704 int smb_lookup_sid(smb_sid_t *, char *buf, int buflen);
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
705 int smb_lookup_name(char *, smb_gsid_t *);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
706
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
707 #define SMB_LGRP_SUCCESS 0
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
708 #define SMB_LGRP_INVALID_ARG 1
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
709 #define SMB_LGRP_INVALID_MEMBER 2
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
710 #define SMB_LGRP_INVALID_NAME 3
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
711 #define SMB_LGRP_NOT_FOUND 4
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
712 #define SMB_LGRP_EXISTS 5
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
713 #define SMB_LGRP_NO_SID 6
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
714 #define SMB_LGRP_NO_LOCAL_SID 7
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
715 #define SMB_LGRP_SID_NOTLOCAL 8
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
716 #define SMB_LGRP_WKSID 9
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
717 #define SMB_LGRP_NO_MEMORY 10
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
718 #define SMB_LGRP_DB_ERROR 11
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
719 #define SMB_LGRP_DBINIT_ERROR 12
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
720 #define SMB_LGRP_INTERNAL_ERROR 13
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
721 #define SMB_LGRP_MEMBER_IN_GROUP 14
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
722 #define SMB_LGRP_MEMBER_NOT_IN_GROUP 15
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
723 #define SMB_LGRP_NO_SUCH_PRIV 16
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
724 #define SMB_LGRP_NO_SUCH_DOMAIN 17
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
725 #define SMB_LGRP_PRIV_HELD 18
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
726 #define SMB_LGRP_PRIV_NOT_HELD 19
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
727 #define SMB_LGRP_BAD_DATA 20
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
728 #define SMB_LGRP_NO_MORE 21
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
729 #define SMB_LGRP_DBOPEN_FAILED 22
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
730 #define SMB_LGRP_DBEXEC_FAILED 23
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
731 #define SMB_LGRP_DBINIT_FAILED 24
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
732 #define SMB_LGRP_DOMLKP_FAILED 25
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
733 #define SMB_LGRP_DOMINS_FAILED 26
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
734 #define SMB_LGRP_INSERT_FAILED 27
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
735 #define SMB_LGRP_DELETE_FAILED 28
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
736 #define SMB_LGRP_UPDATE_FAILED 29
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
737 #define SMB_LGRP_LOOKUP_FAILED 30
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
738 #define SMB_LGRP_NOT_SUPPORTED 31
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
739
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
740 #define SMB_LGRP_NAME_CHAR_MAX 32
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
741 #define SMB_LGRP_COMMENT_MAX 256
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
742 #define SMB_LGRP_NAME_MAX (SMB_LGRP_NAME_CHAR_MAX * MTS_MB_CHAR_MAX + 1)
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
743
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
744 /*
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
745 * values for smb_nic_t.smbflags
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
746 */
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
747 #define SMB_NICF_NBEXCL 0x01 /* Excluded from Netbios activities */
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
748 #define SMB_NICF_ALIAS 0x02 /* This is an alias */
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
749
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
750 /*
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
751 * smb_nic_t
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
752 * nic_host actual host name
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
753 * nic_nbname 16-byte NetBIOS host name
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
754 */
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
755 typedef struct {
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
756 char nic_host[MAXHOSTNAMELEN];
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
757 char nic_nbname[NETBIOS_NAME_SZ];
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
758 char nic_cmnt[SMB_PI_MAX_COMMENT];
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
759 char nic_ifname[LIFNAMSIZ];
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
760 smb_inaddr_t nic_ip;
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
761 uint32_t nic_mask;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
762 uint32_t nic_bcast;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
763 uint32_t nic_smbflags;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
764 uint64_t nic_sysflags;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
765 } smb_nic_t;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
766
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
767 typedef struct smb_niciter {
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
768 smb_nic_t ni_nic;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
769 int ni_cookie;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
770 int ni_seqnum;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
771 } smb_niciter_t;
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
772
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
773 /* NIC config functions */
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
774 int smb_nic_init(void);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
775 void smb_nic_fini(void);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
776 int smb_nic_getnum(char *);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
777 int smb_nic_addhost(const char *, const char *, int, const char **);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
778 int smb_nic_delhost(const char *);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
779 int smb_nic_getfirst(smb_niciter_t *);
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
780 int smb_nic_getnext(smb_niciter_t *);
9021
3b15214a2c50 6794156 ADS messages in syslog on domain join failure are too vague
Alan Wright <amw@Sun.COM>
parents: 8871
diff changeset
781 boolean_t smb_nic_is_local(smb_inaddr_t *);
3b15214a2c50 6794156 ADS messages in syslog on domain join failure are too vague
Alan Wright <amw@Sun.COM>
parents: 8871
diff changeset
782 boolean_t smb_nic_is_same_subnet(smb_inaddr_t *);
6030
6bebab7d43d5 6653315 Want smb interface to associate hostname with network interfaces
jb150015
parents: 5772
diff changeset
783
6432
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
784 /* NIC Monitoring functions */
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
785 int smb_nicmon_start(const char *);
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
786 void smb_nicmon_stop(void);
98715880dd9e 6666802 Cannot copy >1023 byte readonly file from Vista client to Solaris CIFS share
as200622
parents: 6139
diff changeset
787
8474
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
788 /*
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
789 * Well-known account structure
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
790 *
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
791 * A security identifier (SID) is a unique value of variable length that
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
792 * is used to identify a security principal or security group in
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
793 * Windows. Well-known SIDs are a group of SIDs that identify generic
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
794 * users or generic groups. Their values remain constant across all
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
795 * operating systems.
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
796 *
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
797 * This structure is defined to store these SIDs and other related
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
798 * information about them (e.g. account and domain names) in a
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
799 * predefined table.
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
800 */
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
801 typedef struct smb_wka {
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
802 uint8_t wka_domidx;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
803 char *wka_sid;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
804 char *wka_name;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
805 uint16_t wka_type;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
806 uint16_t wka_flags;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
807 char *wka_desc;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
808 smb_sid_t *wka_binsid;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
809 } smb_wka_t;
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
810
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
811 /*
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
812 * Defined values for smb_wka.wka_flags
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
813 *
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
814 * SMB_WKAFLG_LGRP_ENABLE Can be added as local group
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
815 */
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
816 #define SMB_WKAFLG_LGRP_ENABLE 0x1
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
817
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
818 /*
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
819 * Well-known account interfaces
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
820 */
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
821 int smb_wka_init(void);
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
822 void smb_wka_fini(void);
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
823 smb_wka_t *smb_wka_lookup_name(char *);
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
824 smb_wka_t *smb_wka_lookup_sid(smb_sid_t *);
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
825 smb_sid_t *smb_wka_get_sid(char *);
8474
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
826 char *smb_wka_get_domain(int);
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
827 uint32_t smb_wka_token_groups(uint32_t, smb_ids_t *);
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
828
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
829 /*
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
830 * In memory account representation
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
831 */
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
832 typedef struct smb_account {
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
833 char *a_name;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
834 char *a_domain;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
835 uint16_t a_type;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
836 smb_sid_t *a_sid;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
837 smb_sid_t *a_domsid;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
838 uint32_t a_rid;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
839 } smb_account_t;
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
840
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
841 uint32_t smb_sam_lookup_name(char *, char *, uint16_t, smb_account_t *);
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
842 uint32_t smb_sam_lookup_sid(smb_sid_t *, smb_account_t *);
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
843 int smb_sam_usr_cnt(void);
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
844 uint32_t smb_sam_usr_groups(smb_sid_t *, smb_ids_t *);
10717
fe0545fc3cdd 6612607 CIFS ADS client should use ldap_sasl_interactive_bind_s API
Alan Wright <amw@Sun.COM>
parents: 10122
diff changeset
845 int smb_sam_grp_cnt(smb_domain_type_t);
8670
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
846 void smb_account_free(smb_account_t *);
6da349c3f817 6792084 smb_node_lookup should not take ownership of the hold on vnode passed as a parameter
jose borrego <Jose.Borrego@Sun.COM>
parents: 8474
diff changeset
847 boolean_t smb_account_validate(smb_account_t *);
8474
7803efd2fa77 6559601 Computer Management fails to create or list shares
jose borrego <Jose.Borrego@Sun.COM>
parents: 8334
diff changeset
848
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
849 /*
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
850 * Security Descriptor functions.
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
851 */
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
852 uint32_t smb_sd_read(char *path, smb_sd_t *, uint32_t);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
853 uint32_t smb_sd_write(char *path, smb_sd_t *, uint32_t);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
854
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
855 /* Kernel Module Interface */
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
856 int smb_kmod_bind(void);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
857 int smb_kmod_setcfg(smb_kmod_cfg_t *);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
858 int smb_kmod_setgmtoff(int32_t);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
859 int smb_kmod_start(int, int, int);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
860 int smb_kmod_tcplisten(int);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
861 int smb_kmod_nbtlisten(int);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
862 int smb_kmod_tcpreceive(void);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
863 int smb_kmod_nbtreceive(void);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
864 void smb_kmod_unbind(void);
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
865 int smb_kmod_share(char *, char *);
10001
d540bbbe2461 6853206 zfs set sharesmb=off fails to unshare the dataset
joyce mcintosh <Joyce.McIntosh@Sun.COM>
parents: 9832
diff changeset
866 int smb_kmod_unshare(char *, char *);
10122
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
867 int smb_kmod_get_open_num(smb_opennum_t *);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
868 int smb_kmod_enum(smb_netsvc_t *);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
869 smb_netsvc_t *smb_kmod_enum_init(smb_svcenum_t *);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
870 void smb_kmod_enum_fini(smb_netsvc_t *);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
871 int smb_kmod_session_close(const char *, const char *);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
872 int smb_kmod_file_close(uint32_t);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
873
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
874 /*
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
875 * Interposer library validation
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
876 */
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
877 #define SMBEX_VERSION 1
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
878 #define SMBEX_KEY "82273fdc-e32a-18c3-3f78-827929dc23ea"
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
879 typedef struct smbex_version {
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
880 uint32_t v_version;
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
881 uuid_t v_uuid;
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
882 } smbex_version_t;
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
883 void *smb_dlopen(void);
96eda55bfd54 6582152 MMC remote service management support
Jordan Brown <Jordan.Brown@Sun.COM>
parents: 10001
diff changeset
884 void smb_dlclose(void *);
9832
3569b6c7f56c 6803042 AUXILIARY tags in libsmb mapfile produce ELF noise and bloated binary
Alan Wright <amw@Sun.COM>
parents: 9021
diff changeset
885
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
886 #ifdef __cplusplus
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
887 }
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
888 #endif
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
889
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
890 #endif /* _LIBSMB_H */