-
Notifications
You must be signed in to change notification settings - Fork 6
/
mr_passthru.c
81 lines (70 loc) · 1.63 KB
/
mr_passthru.c
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
/* matching rule passthru */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2014 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/* ACKNOWLEDGEMENTS:
* This work was initially developed by Pierangelo Masarati for inclusion
* in OpenLDAP Software.
*/
#include "portable.h"
#include "slap.h"
#include "lutil.h"
#include "ac/string.h"
static int
failMatch(
int *matchp,
slap_mask_t flags,
Syntax *syntax,
MatchingRule *mr,
struct berval *value,
void *assertedValue )
{
int match;
struct berval *asserted = (struct berval *) assertedValue;
assert( matchp != NULL );
assert( value != NULL );
assert( assertedValue != NULL );
assert( !BER_BVISNULL( value ) );
assert( !BER_BVISNULL( asserted ) );
match = 1;
*matchp = match;
return LDAP_SUCCESS;
}
static int
mr_passthru_initialize( void )
{
static slap_mrule_defs_rec mr_def = {
"( 1.2.840.113556.1.4.1941 "
"NAME 'inChain' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
"X-PASSTHRU '' "
")",
SLAP_MR_HIDE | SLAP_MR_EXT, NULL,
NULL, dnNormalize, failMatch,
NULL, NULL,
NULL
};
int rc;
/* equality rule */
rc = register_matching_rule( &mr_def );
if ( rc != 0 ) {
return rc;
}
return rc;
}
int
init_module( int argc, char *argv[] )
{
return mr_passthru_initialize();
}