Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / openldap / dist / servers / slapd / back-passwd / config.c
blob2aaa6f722aa877405d8870eee7e3c17eeb2a8c76
1 /* config.c - passwd backend configuration file routine */
2 /* $OpenLDAP: pkg/ldap/servers/slapd/back-passwd/config.c,v 1.14.2.3 2008/02/11 23:26:47 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
10 * Public License.
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
16 /* Portions Copyright (c) 1995 Regents of the University of Michigan.
17 * All rights reserved.
19 * Redistribution and use in source and binary forms are permitted
20 * provided that this notice is preserved and that due credit is given
21 * to the University of Michigan at Ann Arbor. The name of the University
22 * may not be used to endorse or promote products derived from this
23 * software without specific prior written permission. This software
24 * is provided ``as is'' without express or implied warranty.
26 /* ACKNOWLEDGEMENTS:
27 * This work was originally developed by the University of Michigan
28 * (as part of U-MICH LDAP).
31 #include "portable.h"
33 #include <stdio.h>
35 #include <ac/socket.h>
36 #include <ac/string.h>
37 #include <ac/time.h>
39 #include "slap.h"
40 #include "back-passwd.h"
42 int
43 passwd_back_db_config(
44 BackendDB *be,
45 const char *fname,
46 int lineno,
47 int argc,
48 char **argv
51 /* alternate passwd file */
52 if ( strcasecmp( argv[0], "file" ) == 0 ) {
53 #ifdef HAVE_SETPWFILE
54 if ( argc < 2 ) {
55 fprintf( stderr,
56 "%s: line %d: missing filename in \"file <filename>\" line\n",
57 fname, lineno );
58 return( 1 );
60 be->be_private = ch_strdup( argv[1] );
61 #else /* HAVE_SETPWFILE */
62 fprintf( stderr,
63 "%s: line %d: ignoring \"file\" option (not supported on this platform)\n",
64 fname, lineno );
65 #endif /* HAVE_SETPWFILE */
67 /* anything else */
68 } else {
69 return SLAP_CONF_UNKNOWN;
72 return( 0 );