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