2010-10-29 10:55:07 +02:00
/*
2004-05-24 05:35:59 +00:00
Unix SMB / CIFS implementation .
endpoint server for the samr pipe - definitions
Copyright ( C ) Andrew Tridgell 2004
2010-10-29 10:55:07 +02:00
2004-05-24 05:35:59 +00:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2004-05-24 05:35:59 +00:00
( at your option ) any later version .
2010-10-29 10:55:07 +02:00
2004-05-24 05:35:59 +00:00
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
2010-10-29 10:55:07 +02:00
2004-05-24 05:35:59 +00:00
You should have received a copy of the GNU General Public License
2007-07-10 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-05-24 05:35:59 +00:00
*/
2007-12-07 02:37:13 +01:00
# include "param/param.h"
2015-12-28 19:01:54 +00:00
# include "libds/common/roles.h"
2007-12-07 02:37:13 +01:00
2004-05-24 05:35:59 +00:00
/*
this type allows us to distinguish handle types
*/
enum samr_handle {
SAMR_HANDLE_CONNECT ,
SAMR_HANDLE_DOMAIN ,
SAMR_HANDLE_USER ,
SAMR_HANDLE_GROUP ,
SAMR_HANDLE_ALIAS
} ;
/*
state asscoiated with a samr_Connect * ( ) operation
*/
struct samr_connect_state {
2009-04-23 12:19:10 +02:00
struct ldb_context * sam_ctx ;
2004-05-25 16:24:13 +00:00
uint32_t access_mask ;
2004-05-24 05:35:59 +00:00
} ;
2018-10-10 09:20:25 +13:00
/*
* Cache of object GUIDS
*/
struct samr_guid_cache {
unsigned handle ;
unsigned size ;
struct GUID * entries ;
} ;
enum samr_guid_cache_id {
SAMR_QUERY_DISPLAY_INFO_CACHE ,
2018-10-18 10:16:24 +13:00
SAMR_ENUM_DOMAIN_GROUPS_CACHE ,
2018-10-18 13:54:31 +13:00
SAMR_ENUM_DOMAIN_USERS_CACHE ,
2018-10-10 09:20:25 +13:00
SAMR_LAST_CACHE
} ;
2004-05-24 05:35:59 +00:00
/*
state associated with a samr_OpenDomain ( ) operation
*/
struct samr_domain_state {
struct samr_connect_state * connect_state ;
void * sam_ctx ;
2004-05-25 16:24:13 +00:00
uint32_t access_mask ;
2005-06-24 00:18:20 +00:00
struct dom_sid * domain_sid ;
2004-05-24 05:35:59 +00:00
const char * domain_name ;
2006-11-22 00:59:34 +00:00
struct ldb_dn * domain_dn ;
2007-12-07 02:37:13 +01:00
enum server_role role ;
2008-03-14 12:26:03 +11:00
bool builtin ;
struct loadparm_context * lp_ctx ;
2018-10-10 09:20:25 +13:00
struct samr_guid_cache guid_caches [ SAMR_LAST_CACHE ] ;
2004-05-24 05:35:59 +00:00
} ;
/*
state associated with a open account handle
*/
struct samr_account_state {
struct samr_domain_state * domain_state ;
void * sam_ctx ;
2004-05-25 16:24:13 +00:00
uint32_t access_mask ;
2005-06-24 00:18:20 +00:00
struct dom_sid * account_sid ;
2004-05-24 05:35:59 +00:00
const char * account_name ;
2006-11-22 00:59:34 +00:00
struct ldb_dn * account_dn ;
2004-05-24 05:35:59 +00:00
} ;