Mercurial > illumos > illumos-gate
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 |
rev | line source |
---|---|
5331 | 1 /* |
2 * CDDL HEADER START | |
3 * | |
4 * The contents of this file are subject to the terms of the | |
5 * Common Development and Distribution License (the "License"). | |
6 * You may not use this file except in compliance with the License. | |
7 * | |
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
9 * or http://www.opensolaris.org/os/licensing. | |
10 * See the License for the specific language governing permissions | |
11 * and limitations under the License. | |
12 * | |
13 * When distributing Covered Code, include this CDDL HEADER in each | |
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
15 * If applicable, add the following below this CDDL HEADER, with the | |
16 * fields enclosed by brackets "[]" replaced with your own identifying | |
17 * information: Portions Copyright [yyyy] [name of copyright owner] | |
18 * | |
19 * CDDL HEADER END | |
20 */ | |
21 /* | |
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 | 23 * Use is subject to license terms. |
24 */ | |
25 | |
26 #ifndef _LIBSMB_H | |
27 #define _LIBSMB_H | |
28 | |
29 #ifdef __cplusplus | |
30 extern "C" { | |
31 #endif | |
32 | |
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 | 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 | 40 #include <stdlib.h> |
41 #include <libscf.h> | |
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 | 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 | 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 | 49 #include <smbsrv/smb_share.h> |
5331 | 50 #include <smbsrv/ntstatus.h> |
51 #include <smbsrv/smb_door_svc.h> | |
52 #include <smbsrv/alloc.h> | |
53 #include <smbsrv/codepage.h> | |
54 #include <smbsrv/ctype.h> | |
55 #include <smbsrv/hash_table.h> | |
56 #include <smbsrv/msgbuf.h> | |
57 #include <smbsrv/oem.h> | |
58 #include <smbsrv/smb_i18n.h> | |
59 #include <smbsrv/wintypes.h> | |
60 #include <smbsrv/smb_xdr.h> | |
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 | 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 | 69 /* Max value length of all SMB properties */ |
70 #define MAX_VALUE_BUFLEN 512 | |
71 | |
72 #define SMBD_FMRI_PREFIX "network/smb/server" | |
73 #define SMBD_DEFAULT_INSTANCE_FMRI "svc:/network/smb/server:default" | |
74 #define SMBD_PG_NAME "smbd" | |
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 | 77 |
78 #define SMBD_SMF_OK 0 | |
79 #define SMBD_SMF_NO_MEMORY 1 /* no memory for data structures */ | |
80 #define SMBD_SMF_SYSTEM_ERR 2 /* system error, use errno */ | |
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 | 83 |
84 #define SCH_STATE_UNINIT 0 | |
85 #define SCH_STATE_INITIALIZING 1 | |
86 #define SCH_STATE_INIT 2 | |
87 | |
88 typedef struct smb_scfhandle { | |
89 scf_handle_t *scf_handle; | |
90 int scf_state; | |
91 scf_service_t *scf_service; | |
92 scf_scope_t *scf_scope; | |
93 scf_transaction_t *scf_trans; | |
94 scf_transaction_entry_t *scf_entry; | |
95 scf_propertygroup_t *scf_pg; | |
96 scf_instance_t *scf_instance; | |
97 scf_iter_t *scf_inst_iter; | |
98 scf_iter_t *scf_pg_iter; | |
99 } smb_scfhandle_t; | |
100 | |
101 /* | |
102 * CIFS Configuration Management | |
103 */ | |
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 | 106 |
107 SMB_CI_AUTOHOME_MAP, | |
108 | |
109 SMB_CI_DOMAIN_SID, | |
110 SMB_CI_DOMAIN_MEMB, | |
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 | 115 SMB_CI_DOMAIN_SRV, |
116 | |
117 SMB_CI_WINS_SRV1, | |
118 SMB_CI_WINS_SRV2, | |
119 SMB_CI_WINS_EXCL, | |
120 | |
121 SMB_CI_MAX_WORKERS, | |
122 SMB_CI_MAX_CONNECTIONS, | |
123 SMB_CI_KEEPALIVE, | |
124 SMB_CI_RESTRICT_ANON, | |
125 | |
126 SMB_CI_SIGNING_ENABLE, | |
127 SMB_CI_SIGNING_REQD, | |
128 | |
129 SMB_CI_SYNC_ENABLE, | |
130 | |
131 SMB_CI_SECURITY, | |
132 SMB_CI_NBSCOPE, | |
133 SMB_CI_SYS_CMNT, | |
134 SMB_CI_LM_LEVEL, | |
135 | |
136 SMB_CI_ADS_SITE, | |
137 | |
138 SMB_CI_DYNDNS_ENABLE, | |
139 | |
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 | 149 SMB_CI_MAX |
150 } smb_cfg_id_t; | |
151 | |
152 /* SMF helper functions */ | |
153 extern smb_scfhandle_t *smb_smf_scf_init(char *); | |
154 extern void smb_smf_scf_fini(smb_scfhandle_t *); | |
155 extern int smb_smf_start_transaction(smb_scfhandle_t *); | |
156 extern int smb_smf_end_transaction(smb_scfhandle_t *); | |
157 extern int smb_smf_set_string_property(smb_scfhandle_t *, char *, char *); | |
158 extern int smb_smf_get_string_property(smb_scfhandle_t *, char *, | |
159 char *, size_t); | |
160 extern int smb_smf_set_integer_property(smb_scfhandle_t *, char *, int64_t); | |
161 extern int smb_smf_get_integer_property(smb_scfhandle_t *, char *, int64_t *); | |
162 extern int smb_smf_set_boolean_property(smb_scfhandle_t *, char *, uint8_t); | |
163 extern int smb_smf_get_boolean_property(smb_scfhandle_t *, char *, uint8_t *); | |
164 extern int smb_smf_set_opaque_property(smb_scfhandle_t *, char *, | |
165 void *, size_t); | |
166 extern int smb_smf_get_opaque_property(smb_scfhandle_t *, char *, | |
167 void *, size_t); | |
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 | 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 | 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 | 181 |
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 | 187 extern uint8_t smb_config_get_fg_flag(void); |
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 | 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 | 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 | 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 | 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 | 212 uint32_t mode; |
213 } smb_joininfo_t; | |
214 | |
215 /* APIs to communicate with SMB daemon via door calls */ | |
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 | 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 | 223 |
224 /* | |
225 * buffer context structure. This is used to keep track of the buffer | |
226 * context. | |
227 * | |
228 * basep: points to the beginning of the buffer | |
229 * curp: points to the current offset | |
230 * endp: points to the limit of the buffer | |
231 */ | |
232 typedef struct { | |
233 unsigned char *basep; | |
234 unsigned char *curp; | |
235 unsigned char *endp; | |
236 } smb_ctxbuf_t; | |
237 | |
238 extern int smb_ctxbuf_init(smb_ctxbuf_t *ctx, unsigned char *buf, | |
239 size_t buflen); | |
240 extern int smb_ctxbuf_len(smb_ctxbuf_t *ctx); | |
241 extern int smb_ctxbuf_printf(smb_ctxbuf_t *ctx, const char *fmt, ...); | |
242 | |
243 /* Functions to handle SMB daemon communications with idmap service */ | |
244 extern int smb_idmap_start(void); | |
245 extern void smb_idmap_stop(void); | |
246 extern int smb_idmap_restart(void); | |
247 | |
248 /* Miscellaneous functions */ | |
249 extern void hexdump(unsigned char *, int); | |
250 extern size_t bintohex(const char *, size_t, char *, size_t); | |
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 | 255 extern void randomize(char *, unsigned); |
256 extern void rand_hash(unsigned char *, size_t, unsigned char *, size_t); | |
257 | |
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 | 261 extern int smb_getfqhostname(char *, size_t); |
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 | 276 void smb_trace(const char *s); |
277 void smb_tracef(const char *fmt, ...); | |
278 | |
279 /* | |
280 * Authentication | |
281 */ | |
282 | |
283 #define SMBAUTH_LM_MAGIC_STR "KGS!@#$%" | |
284 | |
285 #define SMBAUTH_HASH_SZ 16 /* also LM/NTLM/NTLMv2 Hash size */ | |
286 #define SMBAUTH_LM_RESP_SZ 24 /* also NTLM Response size */ | |
287 #define SMBAUTH_LM_PWD_SZ 14 /* LM password size */ | |
288 #define SMBAUTH_V2_CLNT_CHALLENGE_SZ 8 /* both LMv2 and NTLMv2 */ | |
289 #define SMBAUTH_SESSION_KEY_SZ SMBAUTH_HASH_SZ | |
290 #define SMBAUTH_HEXHASH_SZ (SMBAUTH_HASH_SZ * 2) | |
291 | |
292 #define SMBAUTH_FAILURE 1 | |
293 #define SMBAUTH_SUCCESS 0 | |
294 #define MD_DIGEST_LEN 16 | |
295 | |
296 /* | |
297 * Name Types | |
298 * | |
299 * The list of names near the end of the data blob (i.e. the ndb_names | |
300 * field of the smb_auth_data_blob_t data structure) can be classify into | |
301 * the following types: | |
302 * | |
303 * 0x0000 Indicates the end of the list. | |
304 * 0x0001 The name is a NetBIOS machine name (e.g. server name) | |
305 * 0x0002 The name is an NT Domain NetBIOS name. | |
306 * 0x0003 The name is the server's DNS hostname. | |
307 * 0x0004 The name is a W2K Domain name (a DNS name). | |
308 */ | |
309 #define SMBAUTH_NAME_TYPE_LIST_END 0x0000 | |
310 #define SMBAUTH_NAME_TYPE_SERVER_NETBIOS 0x0001 | |
311 #define SMBAUTH_NAME_TYPE_DOMAIN_NETBIOS 0x0002 | |
312 #define SMBAUTH_NAME_TYPE_SERVER_DNS 0x0003 | |
313 #define SMBAUTH_NAME_TYPE_DOMAIN_DNS 0x0004 | |
314 | |
315 /* | |
316 * smb_auth_name_entry_t | |
317 * | |
318 * Each name entry in the data blob consists of the following 3 fields: | |
319 * | |
320 * nne_type - name type | |
321 * nne_len - the length of the name | |
322 * nne_name - the name, in uppercase UCS-2LE Unicode format | |
323 */ | |
324 typedef struct smb_auth_name_entry { | |
325 unsigned short nne_type; | |
326 unsigned short nne_len; | |
327 mts_wchar_t nne_name[SMB_PI_MAX_DOMAIN * 2]; | |
328 } smb_auth_name_entry_t; | |
329 | |
330 /* | |
331 * smb_auth_data_blob | |
332 * | |
333 * The format of this NTLMv2 data blob structure is as follow: | |
334 * | |
335 * - Blob Signature 0x01010000 (4 bytes) | |
336 * - Reserved (0x00000000) (4 bytes) | |
337 * - Timestamp Little-endian, 64-bit signed value representing | |
338 * the number of tenths of a microsecond since January 1, 1601. | |
339 * (8 bytes) | |
340 * - Client Challenge (8 bytes) | |
341 * - Unknown1 (4 bytes) | |
342 * - List of Target Information (variable length) | |
343 * - Unknown2 (4 bytes) | |
344 */ | |
345 typedef struct smb_auth_data_blob { | |
346 unsigned char ndb_signature[4]; | |
347 unsigned char ndb_reserved[4]; | |
348 uint64_t ndb_timestamp; | |
349 unsigned char ndb_clnt_challenge[SMBAUTH_V2_CLNT_CHALLENGE_SZ]; | |
350 unsigned char ndb_unknown[4]; | |
351 smb_auth_name_entry_t ndb_names[2]; | |
352 unsigned char ndb_unknown2[4]; | |
353 } smb_auth_data_blob_t; | |
354 | |
355 #define SMBAUTH_BLOB_MAXLEN (sizeof (smb_auth_data_blob_t)) | |
356 #define SMBAUTH_CI_MAXLEN SMBAUTH_LM_RESP_SZ | |
357 #define SMBAUTH_CS_MAXLEN (SMBAUTH_BLOB_MAXLEN + SMBAUTH_HASH_SZ) | |
358 | |
359 /* | |
360 * smb_auth_info_t | |
361 * | |
362 * The structure contains all the authentication information | |
363 * needed for the preparaton of the SMBSessionSetupAndx request | |
364 * and the user session key. | |
365 * | |
366 * hash - NTLM hash | |
367 * hash_v2 - NTLMv2 hash | |
368 * ci_len - the length of the case-insensitive password | |
369 * ci - case-insensitive password | |
370 * (If NTLMv2 authentication mechanism is used, it | |
371 * represents the LMv2 response. Otherwise, it | |
372 * is empty.) | |
373 * cs_len - the length of the case-sensitive password | |
374 * cs - case-sensitive password | |
375 * (If NTLMv2 authentication mechanism is used, it | |
376 * represents the NTLMv2 response. Otherwise, it | |
377 * represents the NTLM response.) | |
378 * data_blob - NTLMv2 data blob | |
379 */ | |
380 typedef struct smb_auth_info { | |
381 unsigned char hash[SMBAUTH_HASH_SZ]; | |
382 unsigned char hash_v2[SMBAUTH_HASH_SZ]; | |
383 unsigned short ci_len; | |
384 unsigned char ci[SMBAUTH_CI_MAXLEN]; | |
385 unsigned short cs_len; | |
386 unsigned char cs[SMBAUTH_CS_MAXLEN]; | |
387 int lmcompatibility_lvl; | |
388 smb_auth_data_blob_t data_blob; | |
389 } smb_auth_info_t; | |
390 | |
391 /* | |
392 * SMB password management | |
393 */ | |
394 | |
395 #define SMB_PWF_LM 0x01 /* LM hash is present */ | |
396 #define SMB_PWF_NT 0x02 /* NT hash is present */ | |
397 #define SMB_PWF_DISABLE 0x04 /* Account is disabled */ | |
398 | |
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 | 405 } smb_passwd_t; |
406 | |
407 /* | |
408 * Control flags passed to smb_pwd_setcntl | |
409 */ | |
410 #define SMB_PWC_DISABLE 0x01 | |
411 #define SMB_PWC_ENABLE 0x02 | |
412 #define SMB_PWC_NOLM 0x04 | |
413 | |
414 #define SMB_PWE_SUCCESS 0 | |
415 #define SMB_PWE_USER_UNKNOWN 1 | |
416 #define SMB_PWE_USER_DISABLE 2 | |
417 #define SMB_PWE_CLOSE_FAILED 3 | |
418 #define SMB_PWE_OPEN_FAILED 4 | |
419 #define SMB_PWE_WRITE_FAILED 6 | |
420 #define SMB_PWE_UPDATE_FAILED 7 | |
421 #define SMB_PWE_STAT_FAILED 8 | |
422 #define SMB_PWE_BUSY 9 | |
423 #define SMB_PWE_DENIED 10 | |
424 #define SMB_PWE_SYSTEM_ERROR 11 | |
7052 | 425 #define SMB_PWE_INVALID_PARAM 12 |
426 #define SMB_PWE_NO_MEMORY 13 | |
427 #define SMB_PWE_MAX 14 | |
428 | |
429 typedef struct smb_pwditer { | |
430 void *spi_next; | |
431 } smb_pwditer_t; | |
5331 | 432 |
7052 | 433 typedef struct smb_luser { |
434 char *su_name; | |
435 char *su_fullname; | |
436 char *su_desc; | |
437 uint32_t su_rid; | |
438 uint32_t su_ctrl; | |
439 } smb_luser_t; | |
440 | |
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 | 445 extern int smb_pwd_setpasswd(const char *, const char *); |
446 extern int smb_pwd_setcntl(const char *, int); | |
7052 | 447 |
448 extern int smb_pwd_iteropen(smb_pwditer_t *); | |
449 extern smb_luser_t *smb_pwd_iterate(smb_pwditer_t *); | |
450 extern void smb_pwd_iterclose(smb_pwditer_t *); | |
5331 | 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 | 455 |
456 /* | |
457 * A variation on HMAC-MD5 known as HMACT64 is used by Windows systems. | |
458 * The HMACT64() function is the same as the HMAC-MD5() except that | |
459 * it truncates the input key to 64 bytes rather than hashing it down | |
460 * to 16 bytes using the MD5() function. | |
461 */ | |
462 #define SMBAUTH_HMACT64(D, Ds, K, Ks, digest) \ | |
463 smb_auth_hmac_md5(D, Ds, K, (Ks > 64) ? 64 : Ks, digest) | |
464 | |
465 extern int smb_auth_DES(unsigned char *, int, unsigned char *, int, | |
466 unsigned char *, int); | |
467 | |
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 | 471 |
472 extern int smb_auth_set_info(char *, char *, | |
473 unsigned char *, char *, unsigned char *, | |
474 int, int, smb_auth_info_t *); | |
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 | 479 extern int smb_auth_gen_session_key(smb_auth_info_t *, unsigned char *); |
480 | |
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 | 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 | 485 |
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 | 497 * SMB MAC Signing |
498 */ | |
499 | |
500 #define SMB_MAC_KEY_SZ (SMBAUTH_SESSION_KEY_SZ + SMBAUTH_CS_MAXLEN) | |
501 #define SMB_SIG_OFFS 14 /* signature field offset within header */ | |
502 #define SMB_SIG_SIZE 8 /* SMB signature size */ | |
503 | |
504 /* | |
505 * Signing flags: | |
506 * | |
507 * SMB_SCF_ENABLE Signing is enabled. | |
508 * | |
509 * SMB_SCF_REQUIRED Signing is enabled and required. | |
510 * This flag shouldn't be set if | |
511 * SMB_SCF_ENABLE isn't set. | |
512 * | |
513 * SMB_SCF_STARTED Signing will start after receiving | |
514 * the first non-anonymous SessionSetup | |
515 * request. | |
516 * | |
517 * SMB_SCF_KEY_ISSET_THIS_LOGON Indicates whether the MAC key has just | |
518 * been set for this logon. (prior to | |
519 * sending the SMBSessionSetup request) | |
520 * | |
521 */ | |
522 #define SMB_SCF_ENABLE 0x01 | |
523 #define SMB_SCF_REQUIRED 0x02 | |
524 #define SMB_SCF_STARTED 0x04 | |
525 #define SMB_SCF_KEY_ISSET_THIS_LOGON 0x08 | |
526 | |
527 /* | |
528 * smb_sign_ctx | |
529 * | |
530 * SMB signing context. | |
531 * | |
532 * ssc_seqnum sequence number | |
533 * ssc_keylen mac key length | |
534 * ssc_mid multiplex id - reserved | |
535 * ssc_flags flags | |
536 * ssc_mackey mac key | |
537 * ssc_sign mac signature | |
538 * | |
539 */ | |
540 typedef struct smb_sign_ctx { | |
541 unsigned int ssc_seqnum; | |
542 unsigned short ssc_keylen; | |
543 unsigned short ssc_mid; | |
544 unsigned int ssc_flags; | |
545 unsigned char ssc_mackey[SMB_MAC_KEY_SZ]; | |
546 unsigned char ssc_sign[SMB_SIG_SIZE]; | |
547 } smb_sign_ctx_t; | |
548 | |
549 extern int smb_mac_init(smb_sign_ctx_t *sign_ctx, smb_auth_info_t *auth); | |
550 extern int smb_mac_calc(smb_sign_ctx_t *sign_ctx, | |
551 const unsigned char *buf, size_t buf_len, unsigned char *mac_sign); | |
552 extern int smb_mac_chk(smb_sign_ctx_t *sign_ctx, | |
553 const unsigned char *buf, size_t buf_len); | |
554 extern int smb_mac_sign(smb_sign_ctx_t *sign_ctx, | |
555 unsigned char *buf, size_t buf_len); | |
556 extern void smb_mac_inc_seqnum(smb_sign_ctx_t *sign_ctx); | |
557 extern void smb_mac_dec_seqnum(smb_sign_ctx_t *sign_ctx); | |
558 | |
559 /* | |
560 * Each domain is categorized using the enum values below. | |
561 * The local domain refers to the local machine and is named | |
562 * after the local hostname. The primary domain is the domain | |
563 * that the system joined. All other domains are either | |
564 * trusted or untrusted, as defined by the primary domain PDC. | |
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 | 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 | 585 |
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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 886 #ifdef __cplusplus |
887 } | |
888 #endif | |
889 | |
890 #endif /* _LIBSMB_H */ |