diff options
author | Martin Hedenfal <martinh@cvs.openbsd.org> | 2010-11-04 15:35:01 +0000 |
---|---|---|
committer | Martin Hedenfal <martinh@cvs.openbsd.org> | 2010-11-04 15:35:01 +0000 |
commit | 6efef39574dae700daacc8195b566ee0f0bb7dcb (patch) | |
tree | b390e50e031892cc35a0946ee52b58e46256025d /usr.sbin/ldapd/schema.c | |
parent | 1603c39f4bdda930f5ef64cfa0b5a0dd078e5113 (diff) |
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.
Diffstat (limited to 'usr.sbin/ldapd/schema.c')
-rw-r--r-- | usr.sbin/ldapd/schema.c | 17 |
1 files changed, 16 insertions, 1 deletions
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 <martinh@openbsd.org> @@ -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; +} + |