2003-06-26 23:48:46 +00:00
# ifndef _IDMAP_H_
# define _IDMAP_H_
2003-03-07 23:47:59 +00:00
/*
Unix SMB / CIFS implementation .
Idmap headers
2003-08-01 15:21:20 +00:00
Copyright ( C ) Jim McDonough < jmcd @ us . ibm . com > 2003
2003-03-07 23:47:59 +00:00
Copyright ( C ) Simo Sorce 2003
2011-03-03 12:51:57 +01:00
2003-03-07 23:47:59 +00:00
This library is free software ; you can redistribute it and / or
2007-07-10 04:04:46 +00:00
modify it under the terms of the GNU Lesser General Public
2003-03-07 23:47:59 +00:00
License as published by the Free Software Foundation ; either
2007-07-10 02:31:50 +00:00
version 3 of the License , or ( at your option ) any later version .
2011-03-03 12:51:57 +01:00
2003-03-07 23:47:59 +00:00
This library 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
Library General Public License for more details .
2011-03-03 12:51:57 +01:00
2007-07-10 04:04:46 +00:00
You should have received a copy of the GNU Lesser General Public License
2007-07-10 02:31:50 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-03-07 23:47:59 +00:00
*/
2006-07-11 18:01:26 +00:00
/* The interface version specifier.
Updated to 3 for enum types by JRA . */
2003-05-29 19:08:40 +00:00
2006-12-12 14:52:13 +00:00
/* Updated to 4, completely new interface, SSS */
2008-09-19 13:51:40 -04:00
/* Updated to 5, simplified interface by Volker */
2017-04-20 12:24:43 -07:00
/* Updated to 6, modules now take TALLOC_CTX * init parameter. */
2003-03-07 23:47:59 +00:00
2017-04-20 12:24:43 -07:00
# define SMB_IDMAP_INTERFACE_VERSION 6
2003-03-08 17:29:40 +00:00
2010-08-18 18:13:42 +02:00
# include "librpc/gen_ndr/idmap.h"
2016-12-29 09:56:29 +00:00
struct wbint_userinfo ;
2006-12-12 14:52:13 +00:00
struct idmap_domain {
const char * name ;
2017-09-25 15:39:39 +02:00
/*
* dom_sid is currently only initialized in the unixids_to_sids request ,
* so don ' t rely on this being filled out everywhere !
*/
struct dom_sid dom_sid ;
2019-03-21 12:30:37 +01:00
const struct idmap_methods * methods ;
2016-12-29 09:56:29 +00:00
NTSTATUS ( * query_user ) ( struct idmap_domain * domain ,
struct wbint_userinfo * info ) ;
2010-06-16 16:05:34 +02:00
uint32_t low_id ;
uint32_t high_id ;
2010-07-29 17:51:13 +02:00
bool read_only ;
2008-07-13 12:07:40 +02:00
void * private_data ;
2006-12-12 14:52:13 +00:00
} ;
2003-03-08 17:29:40 +00:00
2003-03-07 23:47:59 +00:00
/* Filled out by IDMAP backends */
struct idmap_methods {
/* Called when backend is first loaded */
2011-03-02 23:00:58 +01:00
NTSTATUS ( * init ) ( struct idmap_domain * dom ) ;
2006-12-12 14:52:13 +00:00
2007-04-19 22:26:09 +00:00
/* Map an array of uids/gids to SIDs. The caller specifies
the uid / gid and type . Gets back the SID . */
2006-12-12 14:52:13 +00:00
NTSTATUS ( * unixids_to_sids ) ( struct idmap_domain * dom , struct id_map * * ids ) ;
2007-04-19 22:26:09 +00:00
/* Map an arry of SIDs to uids/gids. The caller sets the SID
and type and gets back a uid or gid . */
2006-12-12 14:52:13 +00:00
NTSTATUS ( * sids_to_unixids ) ( struct idmap_domain * dom , struct id_map * * ids ) ;
2007-04-19 22:26:09 +00:00
2010-06-22 14:31:24 +02:00
/* Allocate a Unix-ID. */
NTSTATUS ( * allocate_id ) ( struct idmap_domain * dom , struct unixid * id ) ;
2006-12-12 14:52:13 +00:00
} ;
2010-08-18 18:13:42 +02:00
# include "winbindd/idmap_proto.h"
2003-06-26 23:48:46 +00:00
# endif /* _IDMAP_H_ */