diff options
author | Milan Jurik <milan.jurik@xylab.cz> | 2012-05-19 19:59:14 -0700 |
---|---|---|
committer | Milan Jurik <milan.jurik@xylab.cz> | 2012-05-19 19:59:14 -0700 |
commit | d387ac4c164917d885cd84bd1b62647d989033ac (patch) | |
tree | 3c8503aa5915728ea1f848bfaaecb91ab62a4d91 /usr/src/lib/libldap4/common/extensions.c | |
parent | ad2de4358b2074634b0f2355c34b0986da0e95f9 (diff) | |
download | illumos-joyent-d387ac4c164917d885cd84bd1b62647d989033ac.tar.gz |
2705 EOF libldap.so.4
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Albert Lee <trisk@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/lib/libldap4/common/extensions.c')
-rw-r--r-- | usr/src/lib/libldap4/common/extensions.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/usr/src/lib/libldap4/common/extensions.c b/usr/src/lib/libldap4/common/extensions.c deleted file mode 100644 index 247ad2baa5..0000000000 --- a/usr/src/lib/libldap4/common/extensions.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Copyright 1999 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * - * Comments: - * - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <stdio.h> -#include <string.h> - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include <sys/types.h> -#include <sys/socket.h> -#endif - -#include "lber.h" -#include "ldap.h" -#include "ldap-private.h" -#include "ldap-int.h" - -int ldap_create_page_control(LDAP *ld, unsigned int pagesize, struct berval *cookie, char isCritical, LDAPControl **output) -{ - BerElement *ber; - int rc; - - if (NULL == ld || NULL == output) - return (LDAP_PARAM_ERROR); - - if ((ber = ber_alloc_t(LBER_USE_DER)) == NULLBER){ - return (LDAP_NO_MEMORY); - } - - if (ber_printf(ber, "{io}", pagesize, - (cookie && cookie->bv_val) ? cookie->bv_val : "", - (cookie && cookie->bv_val) ? cookie->bv_len : 0) - == LBER_ERROR) { - ber_free(ber, 1); - return (LDAP_ENCODING_ERROR); - } - - rc = ldap_build_control(LDAP_CONTROL_SIMPLE_PAGE, ber, 1, isCritical, - output); - - ld->ld_errno = rc; - return (rc); -} - -int ldap_parse_page_control(LDAP *ld, LDAPControl **controls, unsigned int *totalcount, struct berval **cookie) -{ - int i, rc; - BerElement *theBer; - LDAPControl *listCtrlp; - - for (i = 0; controls[i] != NULL; i++){ - if (strcmp(controls[i]->ldctl_oid, "1.2.840.113556.1.4.319") == 0) { - listCtrlp = controls[i]; - if ((theBer = ber_init(&listCtrlp->ldctl_value)) == NULLBER){ - return (LDAP_NO_MEMORY); - } - if ((rc = ber_scanf(theBer, "{iO}", totalcount, cookie)) == LBER_ERROR){ - ber_free(theBer, 1); - return (LDAP_DECODING_ERROR); - } - ber_free(theBer, 1); - return (LDAP_SUCCESS); - } - } - return (LDAP_CONTROL_NOT_FOUND); -} - |