xref: /titanic_51/usr/src/lib/smbsrv/libmlsvc/common/libmlsvc.h (revision 15d9d0b528387242011cdcc6190c9e598cfe3a07)
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 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_LIBMLSVC_H
27 #define	_LIBMLSVC_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/types.h>
32 #include <smbsrv/ntsid.h>
33 #include <smbsrv/hash_table.h>
34 #include <smbsrv/smb_token.h>
35 #include <smbsrv/smb_privilege.h>
36 #include <smbsrv/lmshare.h>
37 #include <smbsrv/libsmb.h>
38 
39 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 extern int mlsvc_init(void);
44 extern uint32_t mlsvc_lookup_name(char *, nt_sid_t **, uint16_t *);
45 extern uint32_t mlsvc_lookup_sid(nt_sid_t *, char **);
46 extern DWORD lsa_query_primary_domain_info(void);
47 extern DWORD lsa_query_account_domain_info(void);
48 extern DWORD lsa_enum_trusted_domains(void);
49 
50 extern boolean_t locate_resource_pdc(char *);
51 
52 #define	SMB_AUTOHOME_FILE	"smbautohome"
53 #define	SMB_AUTOHOME_PATH	"/etc"
54 
55 typedef struct smb_autohome {
56 	struct smb_autohome *ah_next;
57 	uint32_t ah_hits;
58 	time_t ah_timestamp;
59 	char *ah_name;		/* User account name */
60 	char *ah_path;		/* Home directory path */
61 	char *ah_container;	/* ADS container distinguished name */
62 } smb_autohome_t;
63 
64 extern int smb_autohome_add(const char *);
65 extern int smb_autohome_remove(const char *);
66 extern int smb_is_autohome(const lmshare_info_t *);
67 extern void smb_autohome_setent(void);
68 extern void smb_autohome_endent(void);
69 extern smb_autohome_t *smb_autohome_getent(const char *name);
70 extern smb_autohome_t *smb_autohome_lookup(const char *name);
71 
72 #ifdef	__cplusplus
73 }
74 #endif
75 
76 #endif	/* _LIBMLSVC_H */
77