2 Unix SMB/CIFS implementation.
3 idMap nss template plugin
5 Copyright (C) Gerald Carter 2006
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 3 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 /************************************************************************
26 ***********************************************************************/
28 static NTSTATUS
nss_template_init( struct nss_domain_entry
*e
)
33 /************************************************************************
34 ***********************************************************************/
36 static NTSTATUS
nss_template_get_info( struct nss_domain_entry
*e
,
37 const struct dom_sid
*sid
,
46 if ( !homedir
|| !shell
|| !gecos
)
47 return NT_STATUS_INVALID_PARAMETER
;
49 /* protect against home directories using whitespace in the
51 *homedir
= talloc_strdup( ctx
, lp_template_homedir() );
52 *shell
= talloc_strdup( ctx
, lp_template_shell() );
55 if ( !*homedir
|| !*shell
) {
56 return NT_STATUS_NO_MEMORY
;
62 /**********************************************************************
63 *********************************************************************/
65 static NTSTATUS
nss_template_map_to_alias( TALLOC_CTX
*mem_ctx
,
66 struct nss_domain_entry
*e
,
70 return NT_STATUS_NOT_IMPLEMENTED
;
73 /**********************************************************************
74 *********************************************************************/
76 static NTSTATUS
nss_template_map_from_alias( TALLOC_CTX
*mem_ctx
,
77 struct nss_domain_entry
*e
,
81 return NT_STATUS_NOT_IMPLEMENTED
;
84 /************************************************************************
85 ***********************************************************************/
87 static NTSTATUS
nss_template_close( void )
93 /************************************************************************
94 ***********************************************************************/
96 static struct nss_info_methods nss_template_methods
= {
97 .init
= nss_template_init
,
98 .get_nss_info
= nss_template_get_info
,
99 .map_to_alias
= nss_template_map_to_alias
,
100 .map_from_alias
= nss_template_map_from_alias
,
101 .close_fn
= nss_template_close
104 NTSTATUS
nss_info_template_init( void )
106 return smb_register_idmap_nss(SMB_NSS_INFO_INTERFACE_VERSION
,
108 &nss_template_methods
);