]> git.sur5r.net Git - openldap/blob - servers/slapd/back-passwd/config.c
Improve readability of base output in debugging.
[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
13 void
14 passwd_back_config(
15     Backend     *be,
16     char        *fname,
17     int         lineno,
18     int         argc,
19     char        **argv
20 )
21 {
22         /* alternate passwd file */
23         if ( strcasecmp( argv[0], "file" ) == 0 ) {
24 #ifdef HAVE_SETPWFILE
25                 if ( argc < 2 ) {
26                         fprintf( stderr,
27                 "%s: line %d: missing filename in \"file <filename>\" line\n",
28                             fname, lineno );
29                         exit( 1 );
30                 }
31                 be->be_private = ch_strdup( argv[1] );
32 #else /* HAVE_SETPWFILE */
33                 fprintf( stderr,
34     "%s: line %d: ignoring \"file\" option (not supported on this platform)\n",
35                             fname, lineno );
36 #endif /* HAVE_SETPWFILE */
37
38         /* anything else */
39         } else {
40                 fprintf( stderr,
41 "%s: line %d: unknown directive \"%s\" in passwd database definition (ignored)\n",
42                     fname, lineno, argv[0] );
43         }
44 }