1ldap_get_option(3LDAP)      LDAP Library Functions      ldap_get_option(3LDAP)
2
3
4

NAME

6       ldap_get_option,  ldap_set_option  -  get or set session preferences in
7       the ldap structure.
8

SYNOPSIS

10       cc [ flag... ] file... -lldap [ library... ]
11       #include <lber.h>
12       #include <ldap.h>
13
14       LDAP ldap_set_option(LDAP *ld, int option, void *optdata[]);
15
16
17       LDAP ldap_get_option(LDAP *ld, int option, void optdata[]);
18
19

DESCRIPTION

21       These functions provide an LDAP structure with access to session  pref‐
22       erences.  The  ldap_get_option() function gets session preferences from
23       the LDAP structure. The ldap_set_option() function sets session prefer‐
24       ences in the LDAP structure.
25
26
27       The  ld parameter specifies the connection handle, a pointer to an LDAP
28       structure that contains information about the LDAP  server  connection.
29       The  option  parameter  specifies  the name of the option to be read or
30       modified. The optdata parameter serves as a pointer to the value of the
31       option that you set or get.
32

PARAMETERS

34       The following values can be specified for the option parameter:
35
36       LDAP_OPT_API_INFO
37
38           Retrieves  basic  information  about the LDAP API implementation at
39           execution time. The data type for the optdata parameter is  (LDAPA‐
40           PIInfo *). This option is READ-ONLY and cannot be set.
41
42
43       LDAP_OPT_DEREF
44
45           Determines  how  aliases are handled during a search. The data type
46           for the optdata parameter is (int *). The following values  can  be
47           specified for the optdata parameter:
48
49           LDAP_DEREF_NEVER        Specifies  that  aliases are never derefer‐
50                                   enced.
51
52
53           LDAP_DEREF_SEARCHING    Specifies  that  aliases  are  dereferenced
54                                   when  searching  under the base object, but
55                                   not when finding the base object.
56
57
58           LDAP_DEREF_FINDING      Specifies  that  aliases  are  dereferenced
59                                   when  finding the base object, but not when
60                                   searching under the base object.
61
62
63           LDAP_DEREF_ALWAYS       Specifies that aliases are always  derefer‐
64                                   enced  when  finding  the  base  object and
65                                   searching under the base object.
66
67
68
69       LDAP_OPT_SIZELIMIT
70
71           Specifies the maximum number of entries returned by the  server  in
72           search results. The data type for the optdata parameter is (int *).
73           Setting the optdata parameter to  LDAP_NO_LIMIT  removes  any  size
74           limit enforced by the client.
75
76
77       LDAP_OPT_TIMELIMIT
78
79           Specifies  the  maximum  number of seconds spent by the server when
80           answering a search request. The data type for the optdata parameter
81           is  (int *). Setting the optdata parameter to LDAP_NO_LIMIT removes
82           any time limit enforced by the client.
83
84
85       LDAP_OPT_REFERRALS
86
87           Determines whether the client should  follow  referrals.  The  data
88           type for the optdata parameter is (int *). The following values can
89           be specified for the optdata parameter:
90
91           LDAP_OPT_ON     Specifies that the client should follow referrals.
92
93
94           LDAP_OPT_OFF    Specifies that the client should not follow  refer‐
95                           rals.
96
97           By default, the client follows referrals.
98
99
100       LDAP_OPT_RESTART
101
102           Determines  whether LDAP I/O operations are automatically restarted
103           if aborted prematurely. It can be  set  to  one  of  the  constants
104           LDAP_OPT_ON or LDAP_OPT_OFF.
105
106
107       LDAP_OPT_PROTOCOL_VERSION
108
109           Specifies  the version of the protocol supported by the client. The
110           data type for  the  optdata  parameter  is  (int  *).  The  version
111           LDAP_VERSION2  or  LDAP_VERSION3 can be specified. If no version is
112           set, the default version LDAP_VERSION2 is set. To use LDAP v3  fea‐
113           tures, set the protocol version to LDAP_VERSION3.
114
115
116       LDAP_OPT_SERVER_CONTROLS
117
118           Specifies a pointer to an array of LDAPControl structures that rep‐
119           resent the LDAP v3 server  controls  sent  by  default  with  every
120           request.   The   data   type   for   the   optdata   parameter  for
121           ldap_set_option() is (LDAPControl **). For  ldap_get_option(),  the
122           data type is (LDAPControl ***).
123
124
125       LDAP_OPT_CLIENT_CONTROLS
126
127           Specifies a pointer to an array of LDAPControl structures that rep‐
128           resent the LDAP v3 client  controls  sent  by  default  with  every
129           request.   The   data   type   for   the   optdata   parameter  for
130           ldap_set_option() is (LDAPControl **). For  ldap_get_option(),  the
131           data type is (LDAPControl ***).
132
133
134       LDAP_OPT_API_FEATURE_INFO
135
136           Retrieves version information at execution time about extended fea‐
137           tures of the LDAP API. The data type for the optdata  parameter  is
138           (LDAPAPIFeatureInfo *). This option is READ-ONLY and cannot be set.
139
140
141       LDAP_OPT_HOST_NAME
142
143           Sets  the host name or a list of hosts for the primary LDAP server.
144           The data type for the optdata parameter  for  ldap_set_option()  is
145           (char *). For ldap_get_option(), the data type is (char **).
146
147
148       LDAP_OPT_ERROR_NUMBER
149
150           Specifies  the code of the most recent LDAP error that occurred for
151           this session. The data type for the optdata parameter is (int *).
152
153
154       LDAP_OPT_ERROR_STRING
155
156           Specifies the message returned with the most recent LDAP error that
157           occurred  for this session. The data type for the optdata parameter
158           for ldap_set_option() is (char  *)  and  for  ldap_get_option()  is
159           (char **).
160
161
162       LDAP_OPT_MATCHED_DN
163
164           Specifies  the  matched DN value returned with the most recent LDAP
165           error that occurred for this session. The data type for the optdata
166           parameter    for    ldap_set_option()   is   (char   *)   and   for
167           ldap_get_option() is (char **).
168
169
170       LDAP_OPT_REBIND_ARG
171
172           Sets  the  last  argument  passed  to  the  routine  specified   by
173           LDAP_OPT_REBIND_FN.  This  option  can  also  be set by calling the
174           ldap_set_rebind_proc() function. The  data  type  for  the  optdata
175           parameter is (void * ).
176
177
178       LDAP_OPT_REBIND_FN
179
180           Sets  the  routine  to  be called to authenticate a connection with
181           another LDAP server. For example, the option is  used  to  set  the
182           routine  called  during  the  course of a referral. This option can
183           also be by calling the ldap_set_rebind_proc()  function.  The  data
184           type for the optdata parameter is (LDAP_REBINDPROC_CALLBACK *).
185
186
187       LDAP_OPT_X_SASL_MECH
188
189           Sets  the default SASL mechanism to call ldap_interactive_bind_s().
190           The data type for the optdata parameter is (char * ).
191
192
193       LDAP_OPT_X_SASL_REALM
194
195           Sets the default SASL_REALM. The default SASL_REALM should be  used
196           during  a  SASL challenge in response to a SASL_CB_GETREALM request
197           when using the ldap_interactive_bind_s() function.  The  data  type
198           for the optdata parameter is (char * ).
199
200
201       LDAP_OPT_X_SASL_AUTHCID
202
203           Sets  the  default  SASL_AUTHNAME  used  during a SASL challenge in
204           response to a SASL_CB_AUTHNAME request when using the ldap_interac‐
205           tive_bind_s()  function. The data type for the optdata parameter is
206           (char * ).
207
208
209       LDAP_OPT_X_SASL_AUTHZID
210
211           Sets the default SASL_USER that should be used during a SASL  chal‐
212           lenge  in  response  to  a  SASL_CB_USER  request  when  using  the
213           ldap_interactive_bind_s function. The data  type  for  the  optdata
214           parameter is (char * ).
215
216
217       LDAP_OPT_X_SASL_SSF
218
219           A  read-only  option  used  exclusively  with the ldap_get_option()
220           function. The ldap_get_option() function performs a  sasl_getprop()
221           operation  that gets the SASL_SSF value for the current connection.
222           The data type for the optdata parameter is (sasl_ssf_t * ).
223
224
225       LDAP_OPT_X_SASL_SSF_EXTERNAL
226
227           A write-only option used  exclusively  with  the  ldap_set_option()
228           function.  The ldap_set_option() function performs a sasl_setprop()
229           operation to set the SASL_SSF_EXTERNAL value for the  current  con‐
230           nection.  The  data type for the optdata parameter is (sasl_ssf_t *
231           ).
232
233
234       LDAP_OPT_X_SASL_SECPROPS
235
236           A write-only option used exclusively  with  the  ldap_set_option().
237           This  function  performs  a  sasl_setprop(3SASL)  operation for the
238           SASL_SEC_PROPS  value  for  the  current   connection   during   an
239           ldap_interactive_bind_s()  operation. The data type for the optdata
240           parameter is (char * ), a comma delimited  string  containing  text
241           values  for  any of the SASL_SEC_PROPS that should be set. The text
242           values are:
243
244           noanonymous     Sets the SASL_SEC_NOANONYMOUS flag
245
246
247           nodict          Sets the SASL_SEC_NODICTIONARY flag
248
249
250           noplain         Sets the SASL_SEC_NOPLAINTEXT flag
251
252
253           forwardsec      Sets the SASL_SEC_FORWARD_SECRECY flag
254
255
256           passcred        Sets the SASL_SEC_PASS_CREDENTIALS flag
257
258
259           minssf=N        Sets minssf to the integer value N
260
261
262           maxssf=N        Sets maxssf to the integer value N
263
264
265           maxbufsize=N    Sets maxbufsize to the integer value N
266
267
268
269       LDAP_OPT_X_SASL_SSF_MIN
270
271           Sets  the  default  SSF_MIN  value  used  during  a   ldap_interac‐
272           tive_bind_s() operation. The data type for the optdata parameter is
273           (char * ) numeric string.
274
275
276       LDAP_OPT_X_SASL_SSF_MAX
277
278           Sets  the  default  SSF_MAX  value  used  during  a   ldap_interac‐
279           tive_bind_s() operation. The data type for the optdata parameter is
280           (char * ) numeric string.
281
282
283       LDAP_OPT_X_SASL_MAXBUFSIZE
284
285           Sets the default SSF_MAXBUFSIZE value used during  a  ldap_interac‐
286           tive_bind_s() operation. The data type for the optdata parameter is
287           (char * ) numeric string.
288
289

RETURN VALUES

291       The ldap_set_option() and ldap_get_option() functions return:
292
293       LDAP_SUCCESS    If successful
294
295
296       -1              If unsuccessful
297
298

ATTRIBUTES

300       See attributes(5) for descriptions of the following attributes:
301
302
303
304
305       ┌─────────────────────────────┬─────────────────────────────┐
306       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
307       ├─────────────────────────────┼─────────────────────────────┤
308       │Interface Stability          │Evolving                     │
309       ├─────────────────────────────┼─────────────────────────────┤
310       │MT-Level                     │Safe                         │
311       └─────────────────────────────┴─────────────────────────────┘
312

SEE ALSO

314       ldap_init(3LDAP), sasl_setprop(3SASL), attributes(5)
315

NOTES

317       There are other elements in the  LDAP  structure  that  should  not  be
318       changed.  No  assumptions should be made about the order of elements in
319       the LDAP structure.
320
321
322
323SunOS 5.11                        15 Jan 2004           ldap_get_option(3LDAP)
Impressum