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 _SMBSRV_LSALIB_H 27 #define _SMBSRV_LSALIB_H 28 29 /* 30 * Prototypes for the LSA library and RPC client side library interface. 31 * There are two levels of interface defined here: lsa_xxx and lsar_xxx. 32 * The lsa_xxx functions provide a high level interface which make 33 * multiple RPC calls and do all the work necessary to obtain and return 34 * the requested information. The lsar_xxx functions provide a low level 35 * interface in which each function maps to a single underlying RPC. 36 */ 37 38 #include <smbsrv/ndl/lsarpc.ndl> 39 #include <smbsrv/libmlsvc.h> 40 #include <smbsrv/smb_sid.h> 41 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 /* 48 * lsalib.c 49 */ 50 extern uint32_t lsa_lookup_name(char *, uint16_t, smb_userinfo_t *); 51 extern uint32_t lsa_lookup_sid(smb_sid_t *, smb_userinfo_t *); 52 extern int lsa_lookup_privs(char *, char *, smb_userinfo_t *); 53 extern int lsa_test(char *, char *); 54 55 /* 56 * lsar_open.c 57 */ 58 int lsar_open(char *server, 59 char *domain, 60 char *username, 61 mlsvc_handle_t *domain_handle); 62 63 int lsar_open_policy2(char *server, 64 char *domain, 65 char *username, 66 mlsvc_handle_t *lsa_handle); 67 68 int lsar_open_account(mlsvc_handle_t *lsa_handle, 69 struct mslsa_sid *sid, 70 mlsvc_handle_t *lsa_account_handle); 71 72 int lsar_close(mlsvc_handle_t *lsa_handle); 73 74 75 /* 76 * lsar_lookup.c 77 */ 78 int lsar_query_security_desc(mlsvc_handle_t *lsa_handle); 79 80 DWORD lsar_query_info_policy(mlsvc_handle_t *lsa_handle, WORD infoClass, 81 lsa_info_t *); 82 83 uint32_t lsar_lookup_names(mlsvc_handle_t *lsa_handle, 84 char *name, 85 smb_userinfo_t *user_info); 86 87 uint32_t lsar_lookup_sids(mlsvc_handle_t *lsa_handle, 88 struct mslsa_sid *sid, 89 smb_userinfo_t *user_info); 90 91 DWORD lsar_get_userid(char *server, char *name); 92 93 int lsar_enum_accounts(mlsvc_handle_t *lsa_handle, 94 DWORD *enum_context, 95 struct mslsa_EnumAccountBuf *accounts); 96 97 DWORD lsar_enum_trusted_domains(mlsvc_handle_t *lsa_handle, 98 DWORD *enum_context, lsa_info_t *); 99 100 int lsar_enum_privs_account(mlsvc_handle_t *account_handle, 101 smb_userinfo_t *user_info); 102 103 int lsar_lookup_priv_value(mlsvc_handle_t *lsa_handle, 104 char *name, 105 struct ms_luid *luid); 106 107 int lsar_lookup_priv_name(mlsvc_handle_t *lsa_handle, 108 struct ms_luid *luid, 109 char *name, 110 int namelen); 111 112 DWORD lsar_lookup_priv_display_name(mlsvc_handle_t *lsa_handle, 113 char *name, 114 char *display_name, 115 int display_len); 116 117 uint32_t lsar_lookup_sids2(mlsvc_handle_t *lsa_handle, 118 struct mslsa_sid *sid, 119 smb_userinfo_t *user_info); 120 121 uint32_t lsar_lookup_names2(mlsvc_handle_t *lsa_handle, 122 char *name, 123 smb_userinfo_t *user_info); 124 125 126 #ifdef __cplusplus 127 } 128 #endif 129 130 131 #endif /* _SMBSRV_LSALIB_H */ 132