diff options
author | Martin Hedenfal <martinh@cvs.openbsd.org> | 2010-06-30 04:17:05 +0000 |
---|---|---|
committer | Martin Hedenfal <martinh@cvs.openbsd.org> | 2010-06-30 04:17:05 +0000 |
commit | 38a7187bdfc3d6e73ae6871a39b21642f45e4fdb (patch) | |
tree | 290a0fb55501f38e223583d46d4d1bc7ceae2e6d /usr.sbin | |
parent | 4a01a99fc1546a421f6950b1727f84f4b5179514 (diff) |
Move OBJ_NAME and ATTR_NAME macros to schema.h so it's reachable from
schema parser. Also fix a typo.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ldapd/schema.h | 6 | ||||
-rw-r--r-- | usr.sbin/ldapd/validate.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/ldapd/schema.h b/usr.sbin/ldapd/schema.h index 271a1038d4e..983d7e06b04 100644 --- a/usr.sbin/ldapd/schema.h +++ b/usr.sbin/ldapd/schema.h @@ -1,4 +1,4 @@ -/* $OpenBSD: schema.h,v 1.1 2010/06/29 02:45:46 martinh Exp $ */ +/* $OpenBSD: schema.h,v 1.2 2010/06/30 04:17:04 martinh Exp $ */ /* * Copyright (c) 2010 Martin Hedenfalk <martinh@openbsd.org> @@ -19,6 +19,10 @@ #ifndef _schema_h_ #define _schema_h_ +#define OBJ_NAME(obj) ((obj)->names ? SLIST_FIRST((obj)->names)->name : \ + (obj)->oid) +#define ATTR_NAME(at) OBJ_NAME(at) + enum usage { USAGE_USER_APP, USAGE_DIR_OP, /* operational attribute */ diff --git a/usr.sbin/ldapd/validate.c b/usr.sbin/ldapd/validate.c index 9f8de78b244..3074046886e 100644 --- a/usr.sbin/ldapd/validate.c +++ b/usr.sbin/ldapd/validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: validate.c,v 1.3 2010/06/30 03:24:40 martinh Exp $ */ +/* $OpenBSD: validate.c,v 1.4 2010/06/30 04:17:04 martinh Exp $ */ /* * Copyright (c) 2010 Martin Hedenfalk <martin@bzero.se> @@ -24,10 +24,6 @@ #include "ldapd.h" -#define OBJ_NAME(obj) ((obj)->names ? SLIST_FIRST((obj)->names)->name : \ - (obj)->oid) -#define ATTR_NAME(at) OBJ_NAME(at) - static int validate_required_attributes(struct ber_element *entry, struct object *obj) { @@ -246,7 +242,7 @@ olist_push(struct obj_list *olist, struct object *obj) optr->object = obj; SLIST_INSERT_HEAD(olist, optr, next); - /* Expand the list of object classes along the superior chain. + /* Expand the list of object classes along the superclass chain. */ if (obj->sup != NULL) SLIST_FOREACH(sup, obj->sup, next) @@ -261,7 +257,7 @@ is_super(struct object *sup, struct object *obj) struct obj_ptr *optr; if (sup == NULL || obj->sup == NULL) - return NULL; + return 0; SLIST_FOREACH(optr, obj->sup, next) if (optr->object == sup || is_super(sup, optr->object)) |