Back to index

openldap  2.4.31
config.c
Go to the documentation of this file.
00001 /* config.c - passwd backend configuration file routine */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 1998-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 /* Portions Copyright (c) 1995 Regents of the University of Michigan.
00017  * All rights reserved.
00018  *
00019  * Redistribution and use in source and binary forms are permitted
00020  * provided that this notice is preserved and that due credit is given
00021  * to the University of Michigan at Ann Arbor. The name of the University
00022  * may not be used to endorse or promote products derived from this
00023  * software without specific prior written permission. This software
00024  * is provided ``as is'' without express or implied warranty.
00025  */
00026 /* ACKNOWLEDGEMENTS:
00027  * This work was originally developed by the University of Michigan
00028  * (as part of U-MICH LDAP).
00029  */
00030 
00031 #include "portable.h"
00032 
00033 #include <stdio.h>
00034 
00035 #include <ac/socket.h>
00036 #include <ac/string.h>
00037 #include <ac/time.h>
00038 
00039 #include "slap.h"
00040 #include "back-passwd.h"
00041 #include "config.h"
00042 
00043 static ConfigTable passwdcfg[] = {
00044        { "file", "filename", 2, 2, 0,
00045 #ifdef HAVE_SETPWFILE
00046               ARG_STRING|ARG_OFFSET, NULL,
00047 #else
00048               ARG_IGNORED, NULL,
00049 #endif
00050               "( OLcfgDbAt:9.1 NAME 'olcPasswdFile' "
00051                      "DESC 'File containing passwd records' "
00052                      "EQUALITY caseExactMatch "
00053                      "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
00054        { NULL, NULL, 0, 0, 0, ARG_IGNORED,
00055               NULL, NULL, NULL, NULL }
00056 };
00057 
00058 static ConfigOCs passwdocs[] = {
00059        { "( OLcfgDbOc:9.1 "
00060                      "NAME 'olcPasswdConfig' "
00061                      "DESC 'Passwd backend configuration' "
00062                      "SUP olcDatabaseConfig "
00063                      "MAY olcPasswdFile )",
00064                      Cft_Database, passwdcfg },
00065        { NULL, 0, NULL }
00066 };
00067 
00068 int
00069 passwd_back_init_cf( BackendInfo *bi )
00070 {
00071        bi->bi_cf_ocs = passwdocs;
00072        return config_register_schema( passwdcfg, passwdocs );
00073 }