2007-01-24 04:48:08 +03: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 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 .
2011-02-26 14:36:19 +03: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 .
2011-02-26 14:36:19 +03: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
*/
# include "includes.h"
2010-07-02 02:32:52 +04:00
# include "ads.h"
2007-01-24 04:48:08 +03:00
# 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 ,
2010-05-21 05:25:01 +04:00
const struct dom_sid * sid ,
2007-01-24 04:48:08 +03:00
TALLOC_CTX * ctx ,
2009-08-01 18:38:13 +04:00
const char * * homedir ,
const char * * shell ,
const char * * gecos ,
2007-08-11 20:20:27 +04:00
gid_t * gid )
2007-01-24 04:48:08 +03:00
{
if ( ! homedir | | ! shell | | ! gecos )
return NT_STATUS_INVALID_PARAMETER ;
2011-02-26 14:36:19 +03:00
2008-09-16 00:41:37 +04:00
/* protect against home directories using whitespace in the
username */
2007-01-24 04:48:08 +03:00
* homedir = talloc_strdup ( ctx , lp_template_homedir ( ) ) ;
* shell = talloc_strdup ( ctx , lp_template_shell ( ) ) ;
if ( ! * homedir | | ! * shell ) {
return NT_STATUS_NO_MEMORY ;
}
2011-02-26 14:36:19 +03:00
2007-01-24 04:48:08 +03:00
return NT_STATUS_OK ;
}
2008-09-16 00:41:37 +04:00
/**********************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_map_to_alias ( TALLOC_CTX * mem_ctx ,
2008-12-01 06:17:55 +03:00
struct nss_domain_entry * e ,
2008-09-16 00:41:37 +04: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 06:17:55 +03:00
struct nss_domain_entry * e ,
2008-09-16 00:41:37 +04:00
const char * alias ,
char * * name )
{
return NT_STATUS_NOT_IMPLEMENTED ;
}
2007-01-24 04:48:08 +03:00
/************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static NTSTATUS nss_template_close ( void )
{
return NT_STATUS_OK ;
}
/************************************************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static struct nss_info_methods nss_template_methods = {
2008-09-16 00:41:37 +04: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 04:48:08 +03:00
} ;
2011-02-26 14:36:19 +03:00
2007-01-24 04:48:08 +03:00
NTSTATUS nss_info_template_init ( void )
{
return smb_register_idmap_nss ( SMB_NSS_INFO_INTERFACE_VERSION ,
" template " ,
& nss_template_methods ) ;
}
2007-01-24 07:46:35 +03:00