nsswitch/nss_info_template.c

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003    idMap nss template plugin
00004 
00005    Copyright (C) Gerald Carter             2006
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011    
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016    
00017    You should have received a copy of the GNU Library General Public
00018    License along with this library; if not, write to the
00019    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020    Boston, MA  02111-1307, USA.   
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 

Sambaに対してSat Aug 29 21:23:09 2009に生成されました。  doxygen 1.4.7