]> git.sur5r.net Git - openldap/blob - servers/slapd/back-passwd/config.c
Updated some items
[openldap] / servers / slapd / back-passwd / config.c
1 /* config.c - passwd backend configuration file routine */
2
3 #include "portable.h"
4
5 #include <stdio.h>
6
7 #include <ac/socket.h>
8 #include <ac/string.h>
9 #include <ac/time.h>
10
11 #include "slap.h"
12 #include "external.h"
13
14 int
15 passwd_back_db_config(
16     BackendDB   *be,
17     char        *fname,
18     int         lineno,
19     int         argc,
20     char        **argv
21 )
22 {
23         /* alternate passwd file */
24         if ( strcasecmp( argv[0], "file" ) == 0 ) {
25 #ifdef HAVE_SETPWFILE
26                 if ( argc < 2 ) {
27                         fprintf( stderr,
28                 "%s: line %d: missing filename in \"file <filename>\" line\n",
29                             fname, lineno );
30                         return( 1 );
31                 }
32                 be->be_private = ch_strdup( argv[1] );
33 #else /* HAVE_SETPWFILE */
34                 fprintf( stderr,
35     "%s: line %d: ignoring \"file\" option (not supported on this platform)\n",
36                             fname, lineno );
37 #endif /* HAVE_SETPWFILE */
38
39         /* anything else */
40         } else {
41                 fprintf( stderr,
42 "%s: line %d: unknown directive \"%s\" in passwd database definition (ignored)\n",
43                     fname, lineno, argv[0] );
44         }
45
46         return( 0 );
47 }