1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
|
'\" te
.\" Copyright (C) 1990, Regents of the University of Michigan. All Rights Reserved.
.\" Portions Copyright (C) 2004, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LDAP_GET_OPTION 3LDAP "Jan 15, 2004"
.SH NAME
ldap_get_option, ldap_set_option \- get or set session preferences in the
\fBldap\fR structure.
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lldap\fR [ \fIlibrary\fR... ]
#include <lber.h>
#include <ldap.h>
\fBLDAP\fR \fBldap_set_option\fR(\fBLDAP\fR \fI*ld\fR, \fBint\fR \fIoption\fR, \fBvoid\fR \fI*optdata\fR[]);
.fi
.LP
.nf
\fBLDAP\fR \fBldap_get_option\fR(\fBLDAP\fR \fI*ld\fR, \fBint\fR \fIoption\fR, \fBvoid\fR \fIoptdata\fR[]);
.fi
.SH DESCRIPTION
.sp
.LP
These functions provide an \fBLDAP\fR structure with access to session
preferences. The \fBldap_get_option()\fR function gets session preferences from
the \fBLDAP\fR structure. The \fBldap_set_option()\fR function sets session
preferences in the \fBLDAP\fR structure.
.sp
.LP
The \fIld\fR parameter specifies the connection handle, a pointer to an
\fBLDAP\fR structure that contains information about the \fBLDAP\fR server
connection. The \fIoption\fR parameter specifies the name of the option to be
read or modified. The \fIoptdata\fR parameter serves as a pointer to the value
of the option that you set or get.
.SH PARAMETERS
.sp
.LP
The following values can be specified for the \fIoption\fR parameter:
.sp
.ne 2
.na
\fB\fBLDAP_OPT_API_INFO\fR\fR
.ad
.sp .6
.RS 4n
Retrieves basic information about the \fBLDAP\fR \fBAPI\fR implementation at
execution time. The data type for the \fIoptdata\fR parameter is
\fB(LDAPAPIInfo *)\fR. This option is READ-ONLY and cannot be set.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_DEREF\fR\fR
.ad
.sp .6
.RS 4n
Determines how aliases are handled during a search. The data type for the
\fIoptdata\fR parameter is \fB(int *)\fR. The following values can be specified
for the \fIoptdata\fR parameter:
.sp
.ne 2
.na
\fB\fBLDAP_DEREF_NEVER\fR\fR
.ad
.RS 24n
Specifies that aliases are never dereferenced.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_DEREF_SEARCHING\fR\fR
.ad
.RS 24n
Specifies that aliases are dereferenced when searching under the base object,
but not when finding the base object.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_DEREF_FINDING\fR\fR
.ad
.RS 24n
Specifies that aliases are dereferenced when finding the base object, but not
when searching under the base object.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_DEREF_ALWAYS\fR\fR
.ad
.RS 24n
Specifies that aliases are always dereferenced when finding the base object and
searching under the base object.
.RE
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_SIZELIMIT\fR\fR
.ad
.sp .6
.RS 4n
Specifies the maximum number of entries returned by the server in search
results. The data type for the \fIoptdata\fR parameter is \fB(int *)\fR.
Setting the \fIoptdata\fR parameter to \fBLDAP_NO_LIMIT\fR removes any size
limit enforced by the client.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_TIMELIMIT\fR\fR
.ad
.sp .6
.RS 4n
Specifies the maximum number of seconds spent by the server when answering a
search request. The data type for the \fIoptdata\fR parameter is \fB(int *)\fR.
Setting the \fIoptdata\fR parameter to \fBLDAP_NO_LIMIT\fR removes any time
limit enforced by the client.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_REFERRALS\fR\fR
.ad
.sp .6
.RS 4n
Determines whether the client should follow referrals. The data type for the
\fIoptdata\fR parameter is \fB(int *)\fR. The following values can be specified
for the \fIoptdata\fR parameter:
.sp
.ne 2
.na
\fB\fBLDAP_OPT_ON\fR\fR
.ad
.RS 16n
Specifies that the client should follow referrals.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_OFF\fR\fR
.ad
.RS 16n
Specifies that the client should not follow referrals.
.RE
By default, the client follows referrals.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_RESTART\fR\fR
.ad
.sp .6
.RS 4n
Determines whether \fBLDAP\fR I/O operations are automatically restarted if
aborted prematurely. It can be set to one of the constants \fBLDAP_OPT_ON\fR or
\fBLDAP_OPT_OFF\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_PROTOCOL_VERSION\fR\fR
.ad
.sp .6
.RS 4n
Specifies the version of the protocol supported by the client. The data type
for the \fIoptdata\fR parameter is \fB(int *)\fR. The version
\fBLDAP_VERSION2\fR or \fBLDAP_VERSION3\fR can be specified. If no version is
set, the default version \fBLDAP_VERSION2\fR is set. To use \fBLDAP\fR v3
features, set the protocol version to \fBLDAP_VERSION3\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_SERVER_CONTROLS\fR\fR
.ad
.sp .6
.RS 4n
Specifies a pointer to an array of \fBLDAPControl\fR structures that represent
the \fBLDAP\fR v3 server controls sent by default with every request. The data
type for the \fIoptdata\fR parameter for \fBldap_set_option()\fR is
\fB(LDAPControl **)\fR. For \fBldap_get_option()\fR, the data type is
\fB(LDAPControl ***)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_CLIENT_CONTROLS\fR\fR
.ad
.sp .6
.RS 4n
Specifies a pointer to an array of \fBLDAPControl\fR structures that represent
the \fBLDAP\fR v3 client controls sent by default with every request. The data
type for the \fIoptdata\fR parameter for \fBldap_set_option()\fR is
\fB(LDAPControl **)\fR. For \fBldap_get_option()\fR, the data type is
\fB(LDAPControl ***)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_API_FEATURE_INFO\fR\fR
.ad
.sp .6
.RS 4n
Retrieves version information at execution time about extended features of the
\fBLDAP\fR \fBAPI\fR. The data type for the \fIoptdata\fR parameter is
\fB(LDAPAPIFeatureInfo *)\fR. This option is READ-ONLY and cannot be set.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_HOST_NAME\fR\fR
.ad
.sp .6
.RS 4n
Sets the host name or a list of hosts for the primary \fBLDAP\fR server. The
data type for the \fIoptdata\fR parameter for \fBldap_set_option()\fR is
\fB(char *)\fR. For \fBldap_get_option()\fR, the data type is \fB(char **)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_ERROR_NUMBER\fR\fR
.ad
.sp .6
.RS 4n
Specifies the code of the most recent \fBLDAP\fR error that occurred for this
session. The data type for the \fIoptdata\fR parameter is \fB(int *)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_ERROR_STRING\fR\fR
.ad
.sp .6
.RS 4n
Specifies the message returned with the most recent \fBLDAP\fR error that
occurred for this session. The data type for the \fIoptdata\fR parameter for
\fBldap_set_option()\fR is \fB(char *)\fR and for \fBldap_get_option()\fR is
\fB(char **)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_MATCHED_DN\fR\fR
.ad
.sp .6
.RS 4n
Specifies the matched \fBDN\fR value returned with the most recent \fBLDAP\fR
error that occurred for this session. The data type for the \fIoptdata\fR
parameter for \fBldap_set_option()\fR is \fB(char *)\fR and for
\fBldap_get_option()\fR is \fB(char **)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_REBIND_ARG\fR\fR
.ad
.sp .6
.RS 4n
Sets the last argument passed to the routine specified by
\fBLDAP_OPT_REBIND_FN\fR. This option can also be set by calling the
\fBldap_set_rebind_proc()\fR function. The data type for the \fIoptdata\fR
parameter is \fB(void * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_REBIND_FN\fR\fR
.ad
.sp .6
.RS 4n
Sets the routine to be called to authenticate a connection with another LDAP
server. For example, the option is used to set the routine called during the
course of a referral. This option can also be by calling the
\fBldap_set_rebind_proc()\fR function. The data type for the \fIoptdata\fR
parameter is \fB(\fR\fBLDAP_REBINDPROC_CALLBACK\fR\fB *)\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_MECH\fR\fR
.ad
.sp .6
.RS 4n
Sets the default SASL mechanism to call \fBldap_interactive_bind_s()\fR. The
data type for the \fIoptdata\fR parameter is \fB(char * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_REALM\fR\fR
.ad
.sp .6
.RS 4n
Sets the default \fBSASL_REALM\fR. The default \fBSASL_REALM\fR should be used
during a SASL challenge in response to a \fBSASL_CB_GETREALM\fR request when
using the \fBldap_interactive_bind_s()\fR function. The data type for the
\fIoptdata\fR parameter is \fB(char * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_AUTHCID\fR\fR
.ad
.sp .6
.RS 4n
Sets the default \fBSASL_AUTHNAME\fR used during a SASL challenge in response
to a \fBSASL_CB_AUTHNAME\fR request when using the
\fBldap_interactive_bind_s()\fR function. The data type for the \fIoptdata\fR
parameter is \fB(char * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_AUTHZID\fR\fR
.ad
.sp .6
.RS 4n
Sets the default \fBSASL_USER\fR that should be used during a SASL challenge in
response to a \fBSASL_CB_USER\fR request when using the
\fBldap_interactive_bind_s\fR function. The data type for the \fIoptdata\fR
parameter is \fB(char * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_SSF\fR\fR
.ad
.sp .6
.RS 4n
A read-only option used exclusively with the \fBldap_get_option()\fR function.
The \fBldap_get_option()\fR function performs a \fBsasl_getprop()\fR operation
that gets the \fBSASL_SSF\fR value for the current connection. The data type
for the \fIoptdata\fR parameter is \fB(sasl_ssf_t * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_SSF_EXTERNAL\fR\fR
.ad
.sp .6
.RS 4n
A write-only option used exclusively with the \fBldap_set_option()\fR function.
The \fBldap_set_option()\fR function performs a \fBsasl_setprop()\fR operation
to set the \fBSASL_SSF_EXTERNAL\fR value for the current connection. The data
type for the \fIoptdata\fR parameter is \fB(sasl_ssf_t * )\fR.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_SECPROPS\fR\fR
.ad
.sp .6
.RS 4n
A write-only option used exclusively with the \fBldap_set_option()\fR. This
function performs a \fBsasl_setprop\fR(3SASL) operation for the
\fBSASL_SEC_PROPS\fR value for the current connection during an
\fBldap_interactive_bind_s()\fR operation. The data type for the \fIoptdata\fR
parameter is \fB(char * )\fR, a comma delimited string containing text values
for any of the \fBSASL_SEC_PROPS\fR that should be set. The text values are:
.sp
.ne 2
.na
\fB\fBnoanonymous\fR\fR
.ad
.RS 16n
Sets the \fBSASL_SEC_NOANONYMOUS\fR flag
.RE
.sp
.ne 2
.na
\fB\fBnodict\fR\fR
.ad
.RS 16n
Sets the \fBSASL_SEC_NODICTIONARY\fR flag
.RE
.sp
.ne 2
.na
\fB\fBnoplain\fR\fR
.ad
.RS 16n
Sets the \fBSASL_SEC_NOPLAINTEXT\fR flag
.RE
.sp
.ne 2
.na
\fB\fBforwardsec\fR\fR
.ad
.RS 16n
Sets the \fBSASL_SEC_FORWARD_SECRECY\fR flag
.RE
.sp
.ne 2
.na
\fB\fBpasscred\fR\fR
.ad
.RS 16n
Sets the \fBSASL_SEC_PASS_CREDENTIALS\fR flag
.RE
.sp
.ne 2
.na
\fB\fBminssf=N\fR\fR
.ad
.RS 16n
Sets \fBminssf\fR to the integer value \fBN\fR
.RE
.sp
.ne 2
.na
\fB\fBmaxssf=N\fR\fR
.ad
.RS 16n
Sets \fBmaxssf\fR to the integer value \fBN\fR
.RE
.sp
.ne 2
.na
\fB\fBmaxbufsize=N\fR\fR
.ad
.RS 16n
Sets \fBmaxbufsize\fR to the integer value \fBN\fR
.RE
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_SSF_MIN\fR\fR
.ad
.sp .6
.RS 4n
Sets the default \fBSSF_MIN\fR value used during a
\fBldap_interactive_bind_s()\fR operation. The data type for the \fIoptdata\fR
parameter is \fB(char * )\fR numeric string.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_SSF_MAX\fR\fR
.ad
.sp .6
.RS 4n
Sets the default \fBSSF_MAX\fR value used during a
\fBldap_interactive_bind_s()\fR operation. The data type for the \fIoptdata\fR
parameter is \fB(char * )\fR numeric string.
.RE
.sp
.ne 2
.na
\fB\fBLDAP_OPT_X_SASL_MAXBUFSIZE\fR\fR
.ad
.sp .6
.RS 4n
Sets the default \fBSSF_MAXBUFSIZE\fR value used during a
\fBldap_interactive_bind_s()\fR operation. The data type for the \fIoptdata\fR
parameter is \fB(char * )\fR numeric string.
.RE
.SH RETURN VALUES
.sp
.LP
The \fBldap_set_option()\fR and \fBldap_get_option()\fR functions return:
.sp
.ne 2
.na
\fB\fBLDAP_SUCCESS\fR\fR
.ad
.RS 16n
If successful
.RE
.sp
.ne 2
.na
\fB\fB-1\fR\fR
.ad
.RS 16n
If unsuccessful
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Evolving
_
MT-Level Safe
.TE
.SH SEE ALSO
.sp
.LP
\fBldap_init\fR(3LDAP), \fBsasl_setprop\fR(3SASL), \fBattributes\fR(5)
.SH NOTES
.sp
.LP
There are other elements in the \fBLDAP\fR structure that should not be
changed. No assumptions should be made about the order of elements in the
\fBLDAP\fR structure.
|