[Bug 6228] SMBC_open_ctx failure due to path resolve failure doesn't set errno
[Samba.git] / source / winbindd / nss_info_template.c
blobaaf02e4abe9ff134b4b65c07559349d9479e9591
1 /*
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/>.
21 #include "includes.h"
22 #include "nss_info.h"
24 /************************************************************************
25 ***********************************************************************/
27 static NTSTATUS nss_template_init( struct nss_domain_entry *e )
29 return NT_STATUS_OK;
32 /************************************************************************
33 ***********************************************************************/
35 static NTSTATUS nss_template_get_info( struct nss_domain_entry *e,
36 const DOM_SID *sid,
37 TALLOC_CTX *ctx,
38 ADS_STRUCT *ads,
39 LDAPMessage *msg,
40 char **homedir,
41 char **shell,
42 char **gecos,
43 gid_t *gid )
45 if ( !homedir || !shell || !gecos )
46 return NT_STATUS_INVALID_PARAMETER;
48 *homedir = talloc_strdup( ctx, lp_template_homedir() );
49 *shell = talloc_strdup( ctx, lp_template_shell() );
50 *gecos = NULL;
52 if ( !*homedir || !*shell ) {
53 return NT_STATUS_NO_MEMORY;
56 return NT_STATUS_OK;
59 /************************************************************************
60 ***********************************************************************/
62 static NTSTATUS nss_template_close( void )
64 return NT_STATUS_OK;
68 /************************************************************************
69 ***********************************************************************/
71 static struct nss_info_methods nss_template_methods = {
72 .init = nss_template_init,
73 .get_nss_info = nss_template_get_info,
74 .close_fn = nss_template_close
77 NTSTATUS nss_info_template_init( void )
79 return smb_register_idmap_nss(SMB_NSS_INFO_INTERFACE_VERSION,
80 "template",
81 &nss_template_methods);