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