From 6efef39574dae700daacc8195b566ee0f0bb7dcb Mon Sep 17 00:00:00 2001 From: Martin Hedenfal Date: Thu, 4 Nov 2010 15:35:01 +0000 Subject: Publish matching rules in the cn=schema subentry as the matchingRules attribute. This is an operational attribute and only returned if explicitly asked for. Required by RFC 4517. --- usr.sbin/ldapd/schema.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ldapd/schema.c') diff --git a/usr.sbin/ldapd/schema.c b/usr.sbin/ldapd/schema.c index 57548b59478..48943ec1ecf 100644 --- a/usr.sbin/ldapd/schema.c +++ b/usr.sbin/ldapd/schema.c @@ -1,4 +1,4 @@ -/* $OpenBSD: schema.c,v 1.13 2010/11/03 14:17:01 martinh Exp $ */ +/* $OpenBSD: schema.c,v 1.14 2010/11/04 15:35:00 martinh Exp $ */ /* * Copyright (c) 2010 Martin Hedenfalk @@ -1333,3 +1333,18 @@ schema_dump_attribute(struct attr_type *at, char *buf, size_t size) return 0; } +int +schema_dump_match_rule(struct match_rule *mr, char *buf, size_t size) +{ + if (strlcpy(buf, "( ", size) >= size || + strlcat(buf, mr->oid, size) >= size || + strlcat(buf, " NAME '", size) >= size || + strlcat(buf, mr->name, size) >= size || + strlcat(buf, "' SYNTAX ", size) >= size || + strlcat(buf, mr->syntax_oid, size) >= size || + strlcat(buf, " )", size) >= size) + return -1; + + return 0; +} + -- cgit v1.2.3