1 /* config.c - shell backend configuration file routine */
2 /* $OpenLDAP: pkg/ldap/servers/slapd/back-shell/config.c,v 1.18.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.
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>.
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.
27 * This work was originally developed by the University of Michigan
28 * (as part of U-MICH LDAP).
35 #include <ac/string.h>
36 #include <ac/socket.h>
50 struct shellinfo
*si
= (struct shellinfo
*) be
->be_private
;
53 fprintf( stderr
, "%s: line %d: shell backend info is null!\n",
58 /* command + args to exec for binds */
59 if ( strcasecmp( argv
[0], "bind" ) == 0 ) {
62 "%s: line %d: missing executable in \"bind <executable>\" line\n",
66 si
->si_bind
= ldap_charray_dup( &argv
[1] );
68 /* command + args to exec for unbinds */
69 } else if ( strcasecmp( argv
[0], "unbind" ) == 0 ) {
72 "%s: line %d: missing executable in \"unbind <executable>\" line\n",
76 si
->si_unbind
= ldap_charray_dup( &argv
[1] );
78 /* command + args to exec for searches */
79 } else if ( strcasecmp( argv
[0], "search" ) == 0 ) {
82 "%s: line %d: missing executable in \"search <executable>\" line\n",
86 si
->si_search
= ldap_charray_dup( &argv
[1] );
88 /* command + args to exec for compares */
89 } else if ( strcasecmp( argv
[0], "compare" ) == 0 ) {
92 "%s: line %d: missing executable in \"compare <executable>\" line\n",
96 si
->si_compare
= ldap_charray_dup( &argv
[1] );
98 /* command + args to exec for modifies */
99 } else if ( strcasecmp( argv
[0], "modify" ) == 0 ) {
102 "%s: line %d: missing executable in \"modify <executable>\" line\n",
106 si
->si_modify
= ldap_charray_dup( &argv
[1] );
108 /* command + args to exec for modrdn */
109 } else if ( strcasecmp( argv
[0], "modrdn" ) == 0 ) {
112 "%s: line %d: missing executable in \"modrdn <executable>\" line\n",
116 si
->si_modrdn
= ldap_charray_dup( &argv
[1] );
118 /* command + args to exec for add */
119 } else if ( strcasecmp( argv
[0], "add" ) == 0 ) {
122 "%s: line %d: missing executable in \"add <executable>\" line\n",
126 si
->si_add
= ldap_charray_dup( &argv
[1] );
128 /* command + args to exec for delete */
129 } else if ( strcasecmp( argv
[0], "delete" ) == 0 ) {
132 "%s: line %d: missing executable in \"delete <executable>\" line\n",
136 si
->si_delete
= ldap_charray_dup( &argv
[1] );
140 return SLAP_CONF_UNKNOWN
;