]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-perl.5
First commit of Hallvard's backend documentation effort
[openldap] / doc / man / man5 / slapd-perl.5
1 .TH SLAPD-PERL 5 "25 April 2002" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .SH NAME
4 slapd-perl \- Perl backend to slapd
5 .SH SYNOPSIS
6 ETCDIR/slapd.conf
7 .SH DESCRIPTION
8 The Perl backend to
9 .BR slapd (8)
10 works by embedding a
11 .BR perl (1)
12 interpreter into
13 .BR slapd (8).
14 Any perl database section of the configuration file
15 .BR slapd.conf (5)
16 must then specify what Perl module to use.
17 .B Slapd
18 then creates a new Perl object that handles all the requests for that
19 particular instance of the backend.
20 .LP
21 You will need to create a method for each one of the
22 following actions:
23 .LP
24 .nf
25   * new        # creates a new object,
26   * search     # performs the ldap search,
27   * compare    # does a compare,
28   * modify     # modifies an entry,
29   * add        # adds an entry to backend,
30   * modrdn     # modifies an entry's rdn,
31   * delete     # deletes an ldap entry,
32   * config     # process unknown config file lines,
33   * init       # called after backend is initialized.
34 .fi
35 .LP
36 Unless otherwise specified, the methods return the result code
37 which will be returned to the client.  Unimplemented actions
38 can just return unwillingToPerform (53).
39 .TP
40 .B new
41 This method is called when the configuration file encounters a 
42 .B perlmod
43 line.
44 The module in that line is then effectively `use'd into the perl
45 interpreter, then the \fBnew\fR method is called to create a new
46 object.
47 Note that multiple instances of that object may be instantiated, as
48 with any perl object.
49 .\" .LP
50 The
51 .B new
52 method receives the class name as argument.
53 .TP
54 .B search
55 This method is called when a search request comes from a client.
56 It arguments are as follows:
57 .nf
58   * object reference
59   * base DN
60   * scope
61   * alias deferencing policy
62   * size limit
63   * time limit
64   * filter string
65   * attributes only flag (1 for yes)
66   * list of attributes that are to be returned (may be empty).
67 .fi
68 .LP
69 Return value: (resultcode, ldif-entry, ldif-entry, ...)
70 .TP
71 .B compare
72 This method is called when a compare request comes from a client.
73 Its arguments are as follows.
74 .nf
75   * object reference
76   * dn
77   * attribute assertion string
78 .fi
79 .LP
80 .TP
81 .B modify
82 This method is called when a modify request comes from a client.
83 Its arguments are as follows.
84 .nf
85   * object reference
86   * dn
87   * a list formatted as follows
88     { "ADD" | "DELETE" | "REPLACE" }, attributetype, value..., ...
89 .fi
90 .LP
91 .TP
92 .B add
93 This method is called when a add request comes from a client.
94 Its arguments are as follows.
95 .nf
96   * object reference
97   * entry in string format.
98 .fi
99 .LP
100 .TP
101 .B modrdn
102 This method is called when a modrdn request comes from a client.
103 Its arguments are as follows.
104 .nf
105   * object reference
106   * dn
107   * new rdn
108   * delete old dn flag (1 means yes)
109 .fi
110 .LP
111 .TP
112 .B delete
113 This method is called when a delete request comes from a client.
114 Its arguments are as follows.
115 .nf
116   * object reference
117   * dn
118 .fi
119 .LP
120 .TP
121 .B config
122 This method is called with unknown
123 .BR slapd.conf (5)
124 configuration file lines.
125 Its arguments are as follows.
126 .nf
127   * object reference
128   * array of arguments on line
129 .fi
130 .LP
131 Return value: nonzero if this is not a valid option.
132 .TP
133 .B init
134 This method is called after backend is initialized.
135 Its argument is as follows.
136 .nf
137   * object reference
138 .fi
139 .LP
140 Return value: nonzero if initialization failed.
141 .SH CONFIGURATION
142 The
143 .BR slapd.conf (5)
144 options in this category apply to the PERL backend database.
145 That is, they must follow a "database perl" line and come before any
146 subsequent "backend" or "database" lines.
147 Other database options are described in the
148 .BR slapd.conf (5)
149 manual page.
150 .TP
151 .B perlModulePath /path/to/libs
152 Add the path to the @INC variable.
153 .TP
154 .B perlModule ModName
155 `Use' the module name ModName from ModName.pm
156 .TP
157 .B filterSearchResults
158 Search results are candidates that need to be filtered (with the
159 filter in the search request), rather than search results to be
160 returned directly to the client.
161 .SH EXAMPLE
162 There is an example Perl module `SampleLDAP' in the slapd/back-perl/
163 direcetory in the OpenLDAP source tree.
164 .SH WARNING
165 The interface of this backend to the perl module MAY change.
166 Any suggestions would greatly be appreciated.
167 .SH SEE ALSO
168 .BR slapd.conf (5),
169 .BR slapd (8),
170 .BR perl (1).