00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "includes.h"
00024 #include "nss_info.h"
00025
00026
00027
00028
00029 static NTSTATUS nss_template_init( struct nss_domain_entry *e )
00030 {
00031 return NT_STATUS_OK;
00032 }
00033
00034
00035
00036
00037 static NTSTATUS nss_template_get_info( struct nss_domain_entry *e,
00038 const DOM_SID *sid,
00039 TALLOC_CTX *ctx,
00040 ADS_STRUCT *ads,
00041 LDAPMessage *msg,
00042 char **homedir,
00043 char **shell,
00044 char **gecos,
00045 gid_t *gid )
00046 {
00047 if ( !homedir || !shell || !gecos )
00048 return NT_STATUS_INVALID_PARAMETER;
00049
00050 *homedir = talloc_strdup( ctx, lp_template_homedir() );
00051 *shell = talloc_strdup( ctx, lp_template_shell() );
00052 *gecos = NULL;
00053
00054 if ( !*homedir || !*shell ) {
00055 return NT_STATUS_NO_MEMORY;
00056 }
00057
00058 return NT_STATUS_OK;
00059 }
00060
00061
00062
00063
00064 static NTSTATUS nss_template_close( void )
00065 {
00066 return NT_STATUS_OK;
00067 }
00068
00069
00070
00071
00072
00073 static struct nss_info_methods nss_template_methods = {
00074 .init = nss_template_init,
00075 .get_nss_info = nss_template_get_info,
00076 .close_fn = nss_template_close
00077 };
00078
00079 NTSTATUS nss_info_template_init( void )
00080 {
00081 return smb_register_idmap_nss(SMB_NSS_INFO_INTERFACE_VERSION,
00082 "template",
00083 &nss_template_methods);
00084 }
00085