adutils.c (bd428526) adutils.c (148c5f43)
1/*
2 * CDDL HEADER START
3 *
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.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 5 unchanged lines hidden (view full) ---

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]
18 *
19 * CDDL HEADER END
20 */
21/*
1/*
2 * CDDL HEADER START
3 *
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.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 5 unchanged lines hidden (view full) ---

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]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
22 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26#include <alloca.h>
27#include <string.h>
28#include <strings.h>
29#include <lber.h>
30#include <sasl/sasl.h>
31#include <string.h>

--- 20 unchanged lines hidden (view full) ---

52 */
53static pthread_mutex_t qstatelock = PTHREAD_MUTEX_INITIALIZER;
54static adutils_query_state_t *qstatehead = NULL;
55
56static char *adutils_sid_ber2str(BerValue *bvalues);
57static void adutils_lookup_batch_unlock(adutils_query_state_t **state);
58static void delete_ds(adutils_ad_t *ad, const char *host, int port);
59
23 */
24
25#include <alloca.h>
26#include <string.h>
27#include <strings.h>
28#include <lber.h>
29#include <sasl/sasl.h>
30#include <string.h>

--- 20 unchanged lines hidden (view full) ---

51 */
52static pthread_mutex_t qstatelock = PTHREAD_MUTEX_INITIALIZER;
53static adutils_query_state_t *qstatehead = NULL;
54
55static char *adutils_sid_ber2str(BerValue *bvalues);
56static void adutils_lookup_batch_unlock(adutils_query_state_t **state);
57static void delete_ds(adutils_ad_t *ad, const char *host, int port);
58
59int ad_debug[AD_DEBUG_MAX+1] = {0};
60
60typedef struct binary_attrs {
61 const char *name;
62 char *(*ber2str)(BerValue *bvalues);
63} binary_attrs_t;
64
65static binary_attrs_t binattrs[] = {
66 {"objectSID", adutils_sid_ber2str},
67 {NULL, NULL}

--- 1630 unchanged lines hidden (view full) ---

1698boolean_t
1699domain_eq(const char *a, const char *b)
1700{
1701 int err;
1702
1703 return (u8_strcmp(a, b, 0, U8_STRCMP_CI_LOWER, U8_UNICODE_LATEST, &err)
1704 == 0 && err == 0);
1705}
61typedef struct binary_attrs {
62 const char *name;
63 char *(*ber2str)(BerValue *bvalues);
64} binary_attrs_t;
65
66static binary_attrs_t binattrs[] = {
67 {"objectSID", adutils_sid_ber2str},
68 {NULL, NULL}

--- 1630 unchanged lines hidden (view full) ---

1699boolean_t
1700domain_eq(const char *a, const char *b)
1701{
1702 int err;
1703
1704 return (u8_strcmp(a, b, 0, U8_STRCMP_CI_LOWER, U8_UNICODE_LATEST, &err)
1705 == 0 && err == 0);
1706}
1707
1708void
1709adutils_set_debug(enum ad_debug item, int value)
1710{
1711 if (item >= 0 && item <= AD_DEBUG_MAX)
1712 ad_debug[item] = value;
1713}