4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
34 #include <sys/types.h>
41 #define NS_LDAP_VERSION NS_LDAP_VERSION_2
42 #define NS_LDAP_VERSION_1 "1.0"
43 #define NS_LDAP_VERSION_2 "2.0"
48 #define NS_LDAP_HARD 0x001
49 #define NS_LDAP_ALL_RES 0x002
51 /* Search Referral Option */
52 typedef enum SearchRef
{
53 NS_LDAP_FOLLOWREF
= 0x004,
57 typedef enum ScopeType
{
58 NS_LDAP_SCOPE_BASE
= 0x010,
59 NS_LDAP_SCOPE_ONELEVEL
= 0x020,
60 NS_LDAP_SCOPE_SUBTREE
= 0x040
64 * BE VERY CAREFUL. DO NOT USE FLAG NS_LDAP_KEEP_CONN UNLESS YOU MUST
65 * IN libsldap.so.1 THERE IS NO CONNECTION GARBAGE COLLECTION AND IF
66 * THIS FLAG GETS USED THERE MIGHT BE A CONNECTION LEAK. CURRENTLY THIS
67 * IS ONLY SUPPORTED FOR LIST AND INTENDED FOR APPLICATIONS LIKE AUTOMOUNTER
70 #define NS_LDAP_KEEP_CONN 0x080
71 #define NS_LDAP_NEW_CONN 0x400
72 #define NS_LDAP_NOMAP 0x800
74 #define NS_LDAP_PAGE_CTRL 0x1000
75 #define NS_LDAP_NO_PAGE_CTRL 0x0000
78 * NS_LDAP_NOT_CVT_DN is needed when attribute mapping is used
79 * to retrieve the DN in LDAP and DN is not to be converted when
80 * being passed back to the application. See __ns_ldap_uid2dn()
81 * and __ns_ldap_host2dn() for such usage.
83 #define NS_LDAP_NOT_CVT_DN 0x2000
86 * NS_LDAP_UPDATE_SHADOW is for a privileged caller of the
87 * __ns_ldap_repAttr() to update the shadow database on the
90 #define NS_LDAP_UPDATE_SHADOW 0x4000
93 * NS_LDAP_READ_SHADOW is for a privileged caller of __ns_ldap_list()
94 * and __ns_ldap_firstEntry() to read the shadow database on the
97 #define NS_LDAP_READ_SHADOW 0x8000
100 * Authentication Information
102 typedef enum CredLevel
{
103 NS_LDAP_CRED_ANON
= 0,
104 NS_LDAP_CRED_PROXY
= 1,
105 NS_LDAP_CRED_SELF
= 2
108 typedef enum AuthType
{
109 NS_LDAP_AUTH_NONE
= 0,
110 NS_LDAP_AUTH_SIMPLE
= 1,
111 NS_LDAP_AUTH_SASL
= 2,
112 NS_LDAP_AUTH_TLS
= 3, /* implied SASL usage */
113 NS_LDAP_AUTH_ATLS
= 4 /* implied SASL usage */
116 typedef enum TlsType
{
117 NS_LDAP_TLS_NONE
= 0,
118 NS_LDAP_TLS_SIMPLE
= 1,
122 typedef enum SaslMech
{
123 NS_LDAP_SASL_NONE
= 0, /* No SASL mechanism */
124 NS_LDAP_SASL_CRAM_MD5
= 1,
125 NS_LDAP_SASL_DIGEST_MD5
= 2,
126 NS_LDAP_SASL_EXTERNAL
= 3, /* currently not supported */
127 NS_LDAP_SASL_GSSAPI
= 4,
128 NS_LDAP_SASL_SPNEGO
= 5 /* currently not supported */
131 typedef enum SaslOpt
{
132 NS_LDAP_SASLOPT_NONE
= 0,
133 NS_LDAP_SASLOPT_INT
= 1,
134 NS_LDAP_SASLOPT_PRIV
= 2
137 typedef enum PrefOnly
{
138 NS_LDAP_PREF_FALSE
= 0,
139 NS_LDAP_PREF_TRUE
= 1
142 typedef enum enableShadowUpdate
{
143 NS_LDAP_ENABLE_SHADOW_UPDATE_FALSE
= 0,
144 NS_LDAP_ENABLE_SHADOW_UPDATE_TRUE
= 1
145 } enableShadowUpdate_t
;
147 typedef struct UnixCred
{
148 char *userID
; /* Unix ID number */
149 char *passwd
; /* password */
152 typedef struct CertCred
{
153 char *path
; /* certificate path */
154 char *passwd
; /* password */
155 char *nickname
; /* nickname */
158 typedef struct ns_auth
{
165 typedef struct ns_cred
{
169 UnixCred_t unix_cred
;
170 CertCred_t cert_cred
;
175 typedef struct LineBuf
{
182 * Configuration Information
186 NS_LDAP_FILE_VERSION_P
= 0,
187 NS_LDAP_BINDDN_P
= 1,
188 NS_LDAP_BINDPASSWD_P
= 2,
189 NS_LDAP_SERVERS_P
= 3,
190 NS_LDAP_SEARCH_BASEDN_P
= 4,
193 * NS_LDAP_TRANSPORT_SEC_P is only left in for backward compatibility
194 * with version 1 clients and their configuration files. The only
195 * supported value is NS_LDAP_SEC_NONE. No application should be
196 * using this parameter type (either through getParam or setParam.
198 NS_LDAP_TRANSPORT_SEC_P
= 6,
199 NS_LDAP_SEARCH_REF_P
= 7,
200 NS_LDAP_DOMAIN_P
= 8,
202 NS_LDAP_CERT_PATH_P
= 10,
203 NS_LDAP_CERT_PASS_P
= 11,
204 NS_LDAP_SEARCH_DN_P
= 12,
205 NS_LDAP_SEARCH_SCOPE_P
= 13,
206 NS_LDAP_SEARCH_TIME_P
= 14,
207 NS_LDAP_SERVER_PREF_P
= 15,
208 NS_LDAP_PREF_ONLY_P
= 16,
209 NS_LDAP_CACHETTL_P
= 17,
210 NS_LDAP_PROFILE_P
= 18,
211 NS_LDAP_CREDENTIAL_LEVEL_P
= 19,
212 NS_LDAP_SERVICE_SEARCH_DESC_P
= 20,
213 NS_LDAP_BIND_TIME_P
= 21,
214 NS_LDAP_ATTRIBUTEMAP_P
= 22,
215 NS_LDAP_OBJECTCLASSMAP_P
= 23,
216 NS_LDAP_CERT_NICKNAME_P
= 24,
217 NS_LDAP_SERVICE_AUTH_METHOD_P
= 25,
218 NS_LDAP_SERVICE_CRED_LEVEL_P
= 26,
219 NS_LDAP_HOST_CERTPATH_P
= 27,
220 NS_LDAP_ENABLE_SHADOW_UPDATE_P
= 28,
221 NS_LDAP_ADMIN_BINDDN_P
= 29,
222 NS_LDAP_ADMIN_BINDPASSWD_P
= 30,
224 * The following entry (max ParamIndexType) is an internal
225 * placeholder. It must be the last (and highest value)
226 * entry in this eNum. Please update accordingly.
228 NS_LDAP_MAX_PIT_P
= 31
233 * NONE - No self / SASL/GSSAPI configured
234 * ONLY - Only self / SASL/GSSAPI configured
235 * MIXED - self / SASL/GSSAPI is mixed with other types of configuration
238 NS_LDAP_SELF_GSSAPI_CONFIG_NONE
= 0,
239 NS_LDAP_SELF_GSSAPI_CONFIG_ONLY
= 1,
240 NS_LDAP_SELF_GSSAPI_CONFIG_MIXED
= 2
241 } ns_ldap_self_gssapi_config_t
;
244 * __ns_ldap_*() return codes
247 NS_LDAP_SUCCESS
= 0, /* success, no info in errorp */
248 NS_LDAP_OP_FAILED
= 1, /* failed operation, no info in errorp */
249 NS_LDAP_NOTFOUND
= 2, /* entry not found, no info in errorp */
250 NS_LDAP_MEMORY
= 3, /* memory failure, no info in errorp */
251 NS_LDAP_CONFIG
= 4, /* config problem, detail in errorp */
252 NS_LDAP_PARTIAL
= 5, /* partial result, detail in errorp */
253 NS_LDAP_INTERNAL
= 7, /* LDAP error, detail in errorp */
254 NS_LDAP_INVALID_PARAM
= 8, /* LDAP error, no info in errorp */
255 NS_LDAP_SUCCESS_WITH_INFO
256 = 9 /* success, with info in errorp */
257 } ns_ldap_return_code
;
260 * Detailed error code for NS_LDAP_CONFIG
263 NS_CONFIG_SYNTAX
= 0, /* syntax error */
264 NS_CONFIG_NODEFAULT
= 1, /* no default value */
265 NS_CONFIG_NOTLOADED
= 2, /* configuration not loaded */
266 NS_CONFIG_NOTALLOW
= 3, /* operation requested not allowed */
267 NS_CONFIG_FILE
= 4, /* configuration file problem */
268 NS_CONFIG_CACHEMGR
= 5 /* error with door to ldap_cachemgr */
269 } ns_ldap_config_return_code
;
272 * Detailed error code for NS_LDAP_PARTIAL
275 NS_PARTIAL_TIMEOUT
= 0, /* partial results due to timeout */
276 NS_PARTIAL_OTHER
= 1 /* error encountered */
277 } ns_ldap_partial_return_code
;
280 * For use by __ns_ldap_addTypedEntry() for publickey serivicetype
283 NS_HOSTCRED_FALSE
= 0,
288 * Detailed password status
291 NS_PASSWD_GOOD
= 0, /* password is good */
292 NS_PASSWD_ABOUT_TO_EXPIRE
= 1, /* password is good but */
293 /* about to expire */
294 NS_PASSWD_CHANGE_NEEDED
= 2, /* good but need to be */
295 /* changed immediately */
296 NS_PASSWD_EXPIRED
= 3, /* password expired */
297 NS_PASSWD_RETRY_EXCEEDED
= 4, /* exceed retry limit; */
298 /* account is locked */
299 NS_PASSWD_CHANGE_NOT_ALLOWED
= 5, /* can only be changed */
300 /* by the administrator */
301 NS_PASSWD_INVALID_SYNTAX
= 6, /* can not be changed: */
302 /* new password has */
303 /* invalid syntax -- */
304 /* trivial password: same */
305 /* value as attr, cn, sn, */
307 /* or strong password */
309 NS_PASSWD_TOO_SHORT
= 7, /* can not be changed: */
310 /* new password has */
311 /* less chars than */
313 NS_PASSWD_IN_HISTORY
= 8, /* can not be changed: */
314 /* reuse old password */
315 NS_PASSWD_WITHIN_MIN_AGE
= 9 /* can not be changed: */
316 /* within minimum age */
317 } ns_ldap_passwd_status_t
;
320 * Password management information structure
322 * This structure is different from AcctUsableResponse_t structure in
323 * that this structure holds result of users account mgmt information when
324 * an ldap bind is done with user name and user password.
326 typedef struct ns_ldap_passwd_mgmt
{
327 ns_ldap_passwd_status_t
328 status
; /* password status */
329 int sec_until_expired
; /* seconds until expired, */
330 /* valid if status is */
331 /* NS_PASSWD_ABOUT_TO_EXPIRE */
332 } ns_ldap_passwd_mgmt_t
;
335 * LDAP V3 control flag for account management - Used for account management
336 * when no password is provided
338 #define NS_LDAP_ACCOUNT_USABLE_CONTROL "1.3.6.1.4.1.42.2.27.9.5.8"
341 * Structure for holding the response returned by server for
342 * NS_LDAP_ACCOUNT_USABLE_CONTROL control when account is not available.
344 typedef struct AcctUsableMoreInfo
{
350 } AcctUsableMoreInfo_t
;
353 * Structure used to hold the response from the server for
354 * NS_LDAP_ACCOUNT_USABLE_CONTROL control. The ASN1 notation is as below:
356 * ACCOUNT_USABLE_RESPONSE::= CHOICE {
357 * is_available [0] INTEGER, seconds before expiration
358 * is_not_available [1] More_info
361 * More_info::= SEQUENCE {
362 * inactive [0] BOOLEAN DEFAULT FALSE,
363 * reset [1] BOOLEAN DEFAULT FALSE,
364 * expired [2] BOOLEAN DEFAULT FALSE,
365 * remaining_grace [3] INTEGER OPTIONAL,
366 * seconds_before_unlock[4] INTEGER OPTIONAL
369 * This structure is different from ns_ldap_passwd_mgmt_t structure in
370 * that this structure holds result of users account mgmt information when
371 * pam_ldap doesn't have the users password and proxy agent is used for
372 * obtaining the account management information.
374 typedef struct AcctUsableResponse
{
377 int seconds_before_expiry
;
378 AcctUsableMoreInfo_t more_info
;
380 } AcctUsableResponse_t
;
383 * Simplified LDAP Naming API result structure
385 typedef struct ns_ldap_error
{
386 int status
; /* LDAP error code */
387 char *message
; /* LDAP error message */
388 ns_ldap_passwd_mgmt_t pwd_mgmt
; /* LDAP password */
389 /* management info */
392 typedef struct ns_ldap_attr
{
393 char *attrname
; /* attribute name */
395 char **attrvalue
; /* attribute values */
398 typedef struct ns_ldap_entry
{
399 uint_t attr_count
; /* number of attributes */
400 ns_ldap_attr_t
**attr_pair
; /* attributes pairs */
401 struct ns_ldap_entry
*next
; /* next entry */
404 typedef struct ns_ldap_result
{
405 uint_t entries_count
; /* number of entries */
406 ns_ldap_entry_t
*entry
; /* data */
410 * structures for the conversion routines used by typedAddEntry()
413 typedef struct _ns_netgroups
{
419 typedef struct _ns_netmasks
{
424 typedef struct _ns_bootp
{
429 typedef struct _ns_ethers
{
434 typedef struct _ns_pubkey
{
441 typedef struct _ns_alias
{
446 typedef struct _ns_automount
{
453 * return values for the callback function in __ns_ldap_list()
455 #define NS_LDAP_CB_NEXT 0 /* get the next entry */
456 #define NS_LDAP_CB_DONE 1 /* done */
459 * Input values for the type specified in __ns_ldap_addTypedEntry()
460 * and __ns_ldap_delTypedEntry()
463 #define NS_LDAP_TYPE_PASSWD "passwd"
464 #define NS_LDAP_TYPE_GROUP "group"
465 #define NS_LDAP_TYPE_HOSTS "hosts"
466 #define NS_LDAP_TYPE_IPNODES "ipnodes"
467 #define NS_LDAP_TYPE_PROFILE "prof_attr"
468 #define NS_LDAP_TYPE_RPC "rpc"
469 #define NS_LDAP_TYPE_PROTOCOLS "protocols"
470 #define NS_LDAP_TYPE_NETWORKS "networks"
471 #define NS_LDAP_TYPE_NETGROUP "netgroup"
472 #define NS_LDAP_TYPE_ALIASES "aliases"
473 #define NS_LDAP_TYPE_SERVICES "services"
474 #define NS_LDAP_TYPE_ETHERS "ethers"
475 #define NS_LDAP_TYPE_SHADOW "shadow"
476 #define NS_LDAP_TYPE_NETMASKS "netmasks"
477 #define NS_LDAP_TYPE_AUTHATTR "auth_attr"
478 #define NS_LDAP_TYPE_EXECATTR "exec_attr"
479 #define NS_LDAP_TYPE_USERATTR "user_attr"
480 #define NS_LDAP_TYPE_PROJECT "project"
481 #define NS_LDAP_TYPE_PUBLICKEY "publickey"
482 #define NS_LDAP_TYPE_AUUSER "audit_user"
483 #define NS_LDAP_TYPE_BOOTPARAMS "bootparams"
484 #define NS_LDAP_TYPE_AUTOMOUNT "auto_"
485 #define NS_LDAP_TYPE_TNRHDB "tnrhdb"
486 #define NS_LDAP_TYPE_TNRHTP "tnrhtp"
489 * service descriptor/attribute mapping structure
492 typedef struct ns_ldap_search_desc
{
493 char *basedn
; /* search base dn */
494 ScopeType_t scope
; /* search scope */
495 char *filter
; /* search filter */
496 } ns_ldap_search_desc_t
;
498 typedef struct ns_ldap_attribute_map
{
499 char *origAttr
; /* original attribute */
500 char **mappedAttr
; /* mapped attribute(s) */
501 } ns_ldap_attribute_map_t
;
503 typedef struct ns_ldap_objectclass_map
{
504 char *origOC
; /* original objectclass */
505 char *mappedOC
; /* mapped objectclass */
506 } ns_ldap_objectclass_map_t
;
509 * Value of the userPassword attribute representing NO Unix password
511 #define NS_LDAP_NO_UNIX_PASSWORD "<NO UNIX PASSWORD>"
513 /* Opaque handle for batch API */
514 typedef struct ns_ldap_list_batch ns_ldap_list_batch_t
;
517 * The type of standalone configuration specified by a client application.
518 * The meaning of the requests is as follows:
520 * NS_CACHEMGR: libsldap will request all the configuration via door_call(3C)
522 * NS_LDAP_SERVER: the consumer application has specified a directory server
524 * NS_PREDEFINED: reserved for internal use
529 } ns_standalone_request_type_t
;
532 * This structure describes an LDAP server specified by a client application.
534 typedef struct ns_dir_server
{
535 char *server
; /* A directory server's IP */
536 uint16_t port
; /* A directory server's port. */
537 /* Default value is 389 */
538 char *domainName
; /* A domain name being served */
539 /* by the specified server. */
540 /* Default value is the local */
542 char *profileName
; /* A DUAProfile's name. */
543 /* Default value is 'default' */
544 ns_auth_t
*auth
; /* Authentication information used */
545 /* during subsequent connections */
546 char *cred
; /* A credential level to be used */
547 /* along with the authentication info */
548 char *host_cert_path
; /* A path to the certificate database */
549 /* Default is '/vat/ldap' */
550 char *bind_dn
; /* A bind DN to be used during */
551 /* subsequent LDAP Bind requests */
552 char *bind_passwd
; /* A bind password to be used during */
553 /* subsequent LDAP Bind requests */
557 * This structure contains information describing an LDAP server.
559 typedef struct ns_standalone_conf
{
561 ns_dir_server_t server
;
562 void *predefined_conf
; /* Reserved for internal use */
563 } ds_profile
; /* A type of the configuration */
565 #define SA_SERVER ds_profile.server.server
566 #define SA_PORT ds_profile.server.port
567 #define SA_DOMAIN ds_profile.server.domainName
568 #define SA_PROFILE_NAME ds_profile.server.profileName
569 #define SA_AUTH ds_profile.server.auth
570 #define SA_CRED ds_profile.server.cred
571 #define SA_CERT_PATH ds_profile.server.host_cert_path
572 #define SA_BIND_DN ds_profile.server.bind_dn
573 #define SA_BIND_PWD ds_profile.server.bind_passwd
575 ns_standalone_request_type_t type
;
576 } ns_standalone_conf_t
;
579 * This function "informs" libsldap that a client application has specified
580 * a directory to use. The function obtains a DUAProfile, credentials,
581 * and naming context. During all further operations on behalf
582 * of the application requested a standalone schema libsldap will use
583 * the information obtained by __ns_ldap_initStandalone() instead of
584 * door_call(3C)ing ldap_cachemgr(1M).
587 * A structure describing where and in which way to obtain all the
588 * configuration describing how to communicate to a choosen LDAP directory.
591 * An error object describing an error occured.
593 ns_ldap_return_code
__ns_ldap_initStandalone(
594 const ns_standalone_conf_t
*conf
,
595 ns_ldap_error_t
**errorp
);
598 * This function obtains the directory's base DN and a DUAProfile
599 * from a specified server.
602 * Specifies the selected directory sever.
605 * Contains an authentication information and credential required to
606 * establish a connection.
609 * If not NULL, a new configuration basing on a DUAProfile specified in the
610 * server parameter will be create and returned.
613 * If not NULL, the directory's base DN will be returned.
616 * Describes an error, if any.
618 ns_ldap_return_code
__ns_ldap_getConnectionInfoFromDUA(
619 const ns_dir_server_t
*server
,
620 const ns_cred_t
*cred
,
621 char **config
, char **baseDN
,
622 ns_ldap_error_t
**error
);
624 #define SA_PROHIBIT_FALLBACK 0
625 #define SA_ALLOW_FALLBACK 1
627 #define DONT_SAVE_NSCONF 0
628 #define SAVE_NSCONF 1
631 * This function obtains the root DSE from a specified server.
634 * An adress of a server to be connected to.
637 * A buffer containing the root DSE in the ldap_cachmgr door call format.
640 * Describes an error, if any.
643 * If set to 1 and establishing a connection fails, __s_api_getRootDSE()
644 * will try once again using anonymous credentials.
646 ns_ldap_return_code
__ns_ldap_getRootDSE(
647 const char *server_addr
,
649 ns_ldap_error_t
**errorp
,
653 * This function iterates through the list of the configured LDAP servers
654 * and "pings" those which are marked as removed or if any error occurred
655 * during the previous receiving of the server's root DSE. If the
656 * function is able to reach such a server and get its root DSE, it
657 * marks the server as on-line. Otherwise, the server's status is set
659 * For each server the function tries to connect to, it fires up
660 * a separate thread and then waits until all the threads finish.
661 * The function returns NS_LDAP_INTERNAL if the Standalone mode was not
662 * initialized or was canceled prior to an invocation of
663 * __ns_ldap_pingOfflineServers().
665 ns_ldap_return_code
__ns_ldap_pingOfflineServers(void);
668 * This function cancels the Standalone mode and destroys the list of root DSEs.
670 void __ns_ldap_cancelStandalone(void);
672 * This function initializes an ns_auth_t structure provided by a caller
673 * according to a specified authentication mechanism.
675 ns_ldap_return_code
__ns_ldap_initAuth(const char *auth_mech
,
677 ns_ldap_error_t
**errorp
);
680 * Simplified LDAP Naming APIs
685 int (*init_filter_cb
)(const ns_ldap_search_desc_t
*desc
,
686 char **realfilter
, const void *userdata
),
687 const char * const *attribute
,
688 const ns_cred_t
*cred
,
690 ns_ldap_result_t
** result
,
691 ns_ldap_error_t
** errorp
,
692 int (*callback
)(const ns_ldap_entry_t
*entry
, const void *userdata
),
693 const void *userdata
);
696 int __ns_ldap_list_sort(
699 const char *sortattr
,
700 int (*init_filter_cb
)(const ns_ldap_search_desc_t
*desc
,
701 char **realfilter
, const void *userdata
),
702 const char * const *attribute
,
703 const ns_cred_t
*cred
,
705 ns_ldap_result_t
** result
,
706 ns_ldap_error_t
** errorp
,
707 int (*callback
)(const ns_ldap_entry_t
*entry
, const void *userdata
),
708 const void *userdata
);
710 int __ns_ldap_list_batch_start(
711 ns_ldap_list_batch_t
**batch
);
713 int __ns_ldap_list_batch_add(
714 ns_ldap_list_batch_t
*batch
,
717 int (*init_filter_cb
)(const ns_ldap_search_desc_t
*desc
,
718 char **realfilter
, const void *userdata
),
719 const char * const *attribute
,
720 const ns_cred_t
*cred
,
722 ns_ldap_result_t
** result
,
723 ns_ldap_error_t
** errorp
,
725 int (*callback
)(const ns_ldap_entry_t
*entry
, const void *userdata
),
726 const void *userdata
);
728 int __ns_ldap_list_batch_end(
729 ns_ldap_list_batch_t
*batch
);
731 void __ns_ldap_list_batch_release(
732 ns_ldap_list_batch_t
*batch
);
734 int __ns_ldap_addAttr(
737 const ns_ldap_attr_t
* const *attr
,
738 const ns_cred_t
*cred
,
740 ns_ldap_error_t
**errorp
);
742 int __ns_ldap_delAttr(
745 const ns_ldap_attr_t
* const *attr
,
746 const ns_cred_t
*cred
,
748 ns_ldap_error_t
**errorp
);
750 int __ns_ldap_repAttr(
753 const ns_ldap_attr_t
* const *attr
,
754 const ns_cred_t
*cred
,
756 ns_ldap_error_t
**errorp
);
758 int __ns_ldap_addEntry(
761 const ns_ldap_entry_t
*entry
,
762 const ns_cred_t
*cred
,
764 ns_ldap_error_t
**errorp
);
766 int __ns_ldap_addTypedEntry(
767 const char *servicetype
,
771 const ns_cred_t
*cred
,
773 ns_ldap_error_t
**errorp
);
775 int __ns_ldap_delEntry(
778 const ns_cred_t
*cred
,
780 ns_ldap_error_t
**errorp
);
782 int __ns_ldap_firstEntry(
785 const char *sortattr
,
786 int (*init_filter_cb
)(const ns_ldap_search_desc_t
*desc
,
787 char **realfilter
, const void *userdata
),
788 const char * const *attribute
,
789 const ns_cred_t
*cred
,
792 ns_ldap_result_t
** result
,
793 ns_ldap_error_t
**errorp
,
794 const void *userdata
);
796 int __ns_ldap_nextEntry(
798 ns_ldap_result_t
** result
,
799 ns_ldap_error_t
**errorp
);
801 int __ns_ldap_endEntry(
803 ns_ldap_error_t
**errorp
);
805 int __ns_ldap_freeResult(
806 ns_ldap_result_t
**result
);
808 int __ns_ldap_freeError(
809 ns_ldap_error_t
**errorp
);
811 int __ns_ldap_uid2dn(
814 const ns_cred_t
*cred
,
815 ns_ldap_error_t
** errorp
);
817 int __ns_ldap_host2dn(
821 const ns_cred_t
*cred
,
822 ns_ldap_error_t
** errorp
);
824 int __ns_ldap_dn2domain(
827 const ns_cred_t
*cred
,
828 ns_ldap_error_t
** errorp
);
831 const ns_cred_t
*cred
,
833 ns_ldap_error_t
**errorp
,
834 LDAPControl
**serverctrls
,
835 LDAPControl
**clientctrls
);
837 int __ns_ldap_freeCred(
840 int __ns_ldap_err2str(
844 int __ns_ldap_setParam(
845 const ParamIndexType type
,
847 ns_ldap_error_t
**errorp
);
849 int __ns_ldap_getParam(
850 const ParamIndexType type
,
852 ns_ldap_error_t
**errorp
);
854 int __ns_ldap_freeParam(
857 char **__ns_ldap_getAttr(
858 const ns_ldap_entry_t
*entry
,
859 const char *attrname
);
861 ns_ldap_attr_t
*__ns_ldap_getAttrStruct(
862 const ns_ldap_entry_t
*entry
,
863 const char *attrname
);
865 int __ns_ldap_getServiceAuthMethods(
868 ns_ldap_error_t
**errorp
);
870 int __ns_ldap_getSearchDescriptors(
872 ns_ldap_search_desc_t
***desc
,
873 ns_ldap_error_t
**errorp
);
875 int __ns_ldap_freeSearchDescriptors(
876 ns_ldap_search_desc_t
***desc
);
878 int __ns_ldap_getAttributeMaps(
880 ns_ldap_attribute_map_t
***maps
,
881 ns_ldap_error_t
**errorp
);
883 int __ns_ldap_freeAttributeMaps(
884 ns_ldap_attribute_map_t
***maps
);
886 char **__ns_ldap_getMappedAttributes(
888 const char *origAttribute
);
890 char **__ns_ldap_getOrigAttribute(
892 const char *mappedAttribute
);
894 int __ns_ldap_getObjectClassMaps(
896 ns_ldap_objectclass_map_t
***maps
,
897 ns_ldap_error_t
**errorp
);
899 int __ns_ldap_freeObjectClassMaps(
900 ns_ldap_objectclass_map_t
***maps
);
902 char **__ns_ldap_getMappedObjectClass(
904 const char *origObjectClass
);
906 char **__ns_ldap_getOrigObjectClass(
908 const char *mappedObjectClass
);
910 int __ns_ldap_getParamType(
912 ParamIndexType
*type
);
914 int __ns_ldap_getAcctMgmt(
916 AcctUsableResponse_t
*acctResp
);
918 boolean_t
__ns_ldap_is_shadow_update_enabled(void);
921 __ns_ldap_self_gssapi_only_set(
924 __ns_ldap_self_gssapi_config(
925 ns_ldap_self_gssapi_config_t
*config
);
930 #endif /* _NS_SLDAP_H */