2007-01-24 01:48:08 +00:00
/*
Unix SMB / CIFS implementation .
idMap nss template plugin
Copyright ( C ) Gerald Carter 2006
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
2007-01-24 01:48:08 +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 .
2008-07-11 17:45:16 +02:00
2007-01-24 01:48:08 +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 .
2008-07-11 17:45:16 +02: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/>.
2007-01-24 01:48:08 +00:00
*/
# include "includes.h"
# include "nss_info.h"
/************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_init ( struct nss_domain_entry * e )
{
return NT_STATUS_OK ;
}
/************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_get_info ( struct nss_domain_entry * e ,
const DOM_SID * sid ,
TALLOC_CTX * ctx ,
ADS_STRUCT * ads ,
LDAPMessage * msg ,
char * * homedir ,
char * * shell ,
char * * gecos ,
2007-08-11 16:20:27 +00:00
gid_t * gid )
2007-01-24 01:48:08 +00:00
{
if ( ! homedir | | ! shell | | ! gecos )
return NT_STATUS_INVALID_PARAMETER ;
2008-07-11 17:45:16 +02:00
2008-09-15 15:41:37 -05:00
/* protect against home directories using whitespace in the
username */
2007-01-24 01:48:08 +00:00
* homedir = talloc_strdup ( ctx , lp_template_homedir ( ) ) ;
* shell = talloc_strdup ( ctx , lp_template_shell ( ) ) ;
* gecos = NULL ;
if ( ! * homedir | | ! * shell ) {
return NT_STATUS_NO_MEMORY ;
}
2008-07-11 17:45:16 +02:00
2007-01-24 01:48:08 +00:00
return NT_STATUS_OK ;
}
2008-09-15 15:41:37 -05:00
/**********************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_map_to_alias ( TALLOC_CTX * mem_ctx ,
2008-12-01 04:17:55 +01:00
struct nss_domain_entry * e ,
2008-09-15 15:41:37 -05:00
const char * name ,
char * * alias )
{
return NT_STATUS_NOT_IMPLEMENTED ;
}
/**********************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_map_from_alias ( TALLOC_CTX * mem_ctx ,
2008-12-01 04:17:55 +01:00
struct nss_domain_entry * e ,
2008-09-15 15:41:37 -05:00
const char * alias ,
char * * name )
{
return NT_STATUS_NOT_IMPLEMENTED ;
}
2007-01-24 01:48:08 +00:00
/************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_close ( void )
{
return NT_STATUS_OK ;
}
/************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static struct nss_info_methods nss_template_methods = {
2008-09-15 15:41:37 -05:00
. init = nss_template_init ,
. get_nss_info = nss_template_get_info ,
. map_to_alias = nss_template_map_to_alias ,
. map_from_alias = nss_template_map_from_alias ,
. close_fn = nss_template_close
2007-01-24 01:48:08 +00:00
} ;
2008-07-11 17:45:16 +02:00
2007-01-24 01:48:08 +00:00
NTSTATUS nss_info_template_init ( void )
{
return smb_register_idmap_nss ( SMB_NSS_INFO_INTERFACE_VERSION ,
" template " ,
& nss_template_methods ) ;
}
2007-01-24 04:46:35 +00:00