1 /* config.c - sock backend configuration file routine */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2007 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
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>.
17 * This work was initially developed by Brian Candler for inclusion
18 * in OpenLDAP Software.
25 #include <ac/string.h>
26 #include <ac/socket.h>
29 #include "back-sock.h"
40 struct sockinfo *si = (struct sockinfo *) be->be_private;
43 fprintf( stderr, "%s: line %d: sock backend info is null!\n",
49 if ( strcasecmp( argv[0], "socketpath" ) == 0 ) {
52 "%s: line %d: exactly one parameter needed for \"socketpath\"\n",
56 si->si_sockpath = ch_strdup( argv[1] );
59 } else if ( strcasecmp( argv[0], "extensions" ) == 0 ) {
61 for ( i=1; i<argc; i++ ) {
62 if ( strcasecmp( argv[i], "binddn" ) == 0 )
63 si->si_extensions |= SOCK_EXT_BINDDN;
64 else if ( strcasecmp( argv[i], "peername" ) == 0 )
65 si->si_extensions |= SOCK_EXT_PEERNAME;
66 else if ( strcasecmp( argv[i], "ssf" ) == 0 )
67 si->si_extensions |= SOCK_EXT_SSF;
70 "%s: line %d: unknown extension \"%s\"\n",
71 fname, lineno, argv[i] );
78 return SLAP_CONF_UNKNOWN;