2007-01-24 04:48:08 +03:00
/*
Unix SMB / CIFS implementation .
Idmap NSS headers
Copyright ( C ) Gerald Carter 2006
This library is free software ; you can redistribute it and / or
2007-07-10 08:04:46 +04:00
modify it under the terms of the GNU Lesser General Public
2007-01-24 04:48:08 +03:00
License as published by the Free Software Foundation ; either
2007-07-10 06:31:50 +04:00
version 3 of the License , or ( at your option ) any later version .
2009-10-04 18:52:08 +04:00
2007-01-24 04:48:08 +03: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 .
2009-10-04 18:52:08 +04:00
2007-07-10 08:04:46 +04:00
You should have received a copy of the GNU Lesser General Public License
2007-07-10 06:31:50 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2007-01-24 04:48:08 +03:00
*/
# ifndef _IDMAP_NSS_H
# define _IDMAP_NSS_H
2007-01-24 17:39:46 +03:00
# ifndef HAVE_LDAP
# ifndef LDAPMessage
# define LDAPMessage void
# endif
# endif
2007-01-24 04:48:08 +03:00
/* The interface version specifier */
# define SMB_NSS_INFO_INTERFACE_VERSION 1
/* List of available backends. All backends must
register themselves */
struct nss_function_entry {
struct nss_function_entry * prev , * next ;
2009-10-04 18:52:08 +04:00
2007-01-24 04:48:08 +03:00
const char * name ;
struct nss_info_methods * methods ;
} ;
/* List of configured domains. Each domain points
back to its configured backend . */
struct nss_domain_entry {
struct nss_domain_entry * prev , * next ;
const char * domain ;
NTSTATUS init_status ;
struct nss_function_entry * backend ;
/* hold state on a per domain basis */
void * state ;
} ;
/* API */
struct nss_info_methods {
NTSTATUS ( * init ) ( struct nss_domain_entry * e ) ;
NTSTATUS ( * get_nss_info ) ( struct nss_domain_entry * e ,
2010-05-21 05:25:01 +04:00
const struct dom_sid * sid ,
2007-01-24 04:48:08 +03:00
TALLOC_CTX * ctx ,
ADS_STRUCT * ads , LDAPMessage * msg ,
2009-08-01 18:38:13 +04:00
const char * * homedir , const char * * shell ,
const char * * gecos , gid_t * p_gid ) ;
2008-12-01 06:17:55 +03:00
NTSTATUS ( * map_to_alias ) ( TALLOC_CTX * mem_ctx ,
struct nss_domain_entry * e ,
const char * name , char * * alias ) ;
NTSTATUS ( * map_from_alias ) ( TALLOC_CTX * mem_ctx ,
struct nss_domain_entry * e ,
const char * alias , char * * name ) ;
2007-01-24 04:48:08 +03:00
NTSTATUS ( * close_fn ) ( void ) ;
} ;
2007-01-24 07:44:27 +03:00
/* The following definitions come from nsswitch/nss_info.c */
NTSTATUS smb_register_idmap_nss ( int version ,
const char * name ,
struct nss_info_methods * methods ) ;
2010-05-21 05:25:01 +04:00
NTSTATUS nss_get_info ( const char * domain , const struct dom_sid * user_sid ,
2009-08-01 18:38:13 +04:00
TALLOC_CTX * ctx ,
2007-01-24 07:44:27 +03:00
ADS_STRUCT * ads , LDAPMessage * msg ,
2009-08-01 18:38:13 +04:00
const char * * homedir , const char * * shell ,
const char * * gecos , gid_t * p_gid ) ;
2007-01-24 07:44:27 +03:00
2008-09-16 00:41:37 +04:00
NTSTATUS nss_map_to_alias ( TALLOC_CTX * mem_ctx , const char * domain ,
const char * name , char * * alias ) ;
NTSTATUS nss_map_from_alias ( TALLOC_CTX * mem_ctx , const char * domain ,
const char * alias , char * * name ) ;
2007-01-24 07:44:27 +03:00
NTSTATUS nss_close ( const char * parameters ) ;
2007-01-24 04:48:08 +03:00
# endif /* _IDMAP_NSS_H_ */
2007-01-24 07:44:27 +03:00