summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraschrijver <aschrijver@openbsd.org>2011-08-28 16:37:28 +0000
committeraschrijver <aschrijver@openbsd.org>2011-08-28 16:37:28 +0000
commite971cb85d3a081d6e5313a8f5c80acfb7991042f (patch)
tree9b7da6f2fe879cac1179825539a21edd4076557f
parentMinor cleanup. (diff)
downloadwireguard-openbsd-e971cb85d3a081d6e5313a8f5c80acfb7991042f.tar.xz
wireguard-openbsd-e971cb85d3a081d6e5313a8f5c80acfb7991042f.zip
Use the correct terminology, replace the term "entry" with the term "attribute" where applicable.
OK martinh@ pyr@
-rw-r--r--usr.sbin/ypldap/aldap.c34
-rw-r--r--usr.sbin/ypldap/aldap.h16
-rw-r--r--usr.sbin/ypldap/ldapclient.c16
3 files changed, 33 insertions, 33 deletions
diff --git a/usr.sbin/ypldap/aldap.c b/usr.sbin/ypldap/aldap.c
index 75b2d9d831b..d99b2a53527 100644
--- a/usr.sbin/ypldap/aldap.c
+++ b/usr.sbin/ypldap/aldap.c
@@ -1,5 +1,5 @@
-/* $Id: aldap.c,v 1.27 2011/04/06 11:36:26 miod Exp $ */
-/* $OpenBSD: aldap.c,v 1.27 2011/04/06 11:36:26 miod Exp $ */
+/* $Id: aldap.c,v 1.28 2011/08/28 16:37:28 aschrijver Exp $ */
+/* $OpenBSD: aldap.c,v 1.28 2011/08/28 16:37:28 aschrijver Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -231,7 +231,7 @@ aldap_parse(struct aldap *ldap)
break;
case LDAP_RES_SEARCH_ENTRY:
if (ber_scanf_elements(m->protocol_op, "{eS{e", &m->dn,
- &m->body.search.entries) != 0)
+ &m->body.search.attrs) != 0)
goto parsefail;
break;
case LDAP_RES_SEARCH_REFERENCE:
@@ -312,15 +312,15 @@ aldap_get_diagmsg(struct aldap_message *msg)
}
int
-aldap_count_entries(struct aldap_message *msg)
+aldap_count_attrs(struct aldap_message *msg)
{
int i;
struct ber_element *a;
- if (msg->body.search.entries == NULL)
+ if (msg->body.search.attrs == NULL)
return (-1);
- for (i = 0, a = msg->body.search.entries;
+ for (i = 0, a = msg->body.search.attrs;
a != NULL && ber_get_eoc(a) != 0;
i++, a = a->be_next)
;
@@ -329,20 +329,20 @@ aldap_count_entries(struct aldap_message *msg)
}
int
-aldap_first_entry(struct aldap_message *msg, char **outkey, char ***outvalues)
+aldap_first_attr(struct aldap_message *msg, char **outkey, char ***outvalues)
{
struct ber_element *b, *c;
char *key;
char **ret;
- if (msg->body.search.entries == NULL)
+ if (msg->body.search.attrs == NULL)
goto fail;
- if (ber_scanf_elements(msg->body.search.entries, "{s(e)}e",
+ if (ber_scanf_elements(msg->body.search.attrs, "{s(e)}e",
&key, &b, &c) != 0)
goto fail;
- msg->body.search.iter = msg->body.search.entries->be_next;
+ msg->body.search.iter = msg->body.search.attrs->be_next;
if ((ret = aldap_get_stringset(b)) == NULL)
goto fail;
@@ -358,7 +358,7 @@ fail:
}
int
-aldap_next_entry(struct aldap_message *msg, char **outkey, char ***outvalues)
+aldap_next_attr(struct aldap_message *msg, char **outkey, char ***outvalues)
{
struct ber_element *a, *b;
char *key;
@@ -367,7 +367,7 @@ aldap_next_entry(struct aldap_message *msg, char **outkey, char ***outvalues)
if (msg->body.search.iter == NULL)
goto notfound;
- LDAP_DEBUG("entry", msg->body.search.iter);
+ LDAP_DEBUG("attr", msg->body.search.iter);
if (ber_get_eoc(msg->body.search.iter) == 0)
goto notfound;
@@ -393,18 +393,18 @@ notfound:
}
int
-aldap_match_entry(struct aldap_message *msg, char *inkey, char ***outvalues)
+aldap_match_attr(struct aldap_message *msg, char *inkey, char ***outvalues)
{
struct ber_element *a, *b;
char *descr = NULL;
char **ret;
- if (msg->body.search.entries == NULL)
+ if (msg->body.search.attrs == NULL)
return (-1);
- LDAP_DEBUG("entry", msg->body.search.entries);
+ LDAP_DEBUG("attr", msg->body.search.attrs);
- for (a = msg->body.search.entries;;) {
+ for (a = msg->body.search.attrs;;) {
if (a == NULL)
goto notfound;
if (ber_get_eoc(a) == 0)
@@ -430,7 +430,7 @@ notfound:
}
int
-aldap_free_entry(char **values)
+aldap_free_attr(char **values)
{
int i;
diff --git a/usr.sbin/ypldap/aldap.h b/usr.sbin/ypldap/aldap.h
index d4238cb42ee..7cb76b7e116 100644
--- a/usr.sbin/ypldap/aldap.h
+++ b/usr.sbin/ypldap/aldap.h
@@ -1,5 +1,5 @@
-/* $Id: aldap.h,v 1.7 2010/02/06 08:04:45 blambert Exp $ */
-/* $OpenBSD: aldap.h,v 1.7 2010/02/06 08:04:45 blambert Exp $ */
+/* $Id: aldap.h,v 1.8 2011/08/28 16:37:28 aschrijver Exp $ */
+/* $OpenBSD: aldap.h,v 1.8 2011/08/28 16:37:28 aschrijver Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -52,7 +52,7 @@ struct aldap_message {
} res;
struct {
struct ber_element *iter;
- struct ber_element *entries;
+ struct ber_element *attrs;
} search;
} body;
struct ber_element *references;
@@ -202,8 +202,8 @@ void aldap_free_url(struct aldap_url *);
int aldap_search_url(struct aldap *, char *, int, int, int);
#endif
-int aldap_count_entries(struct aldap_message *);
-int aldap_match_entry(struct aldap_message *, char *, char ***);
-int aldap_first_entry(struct aldap_message *, char **, char ***);
-int aldap_next_entry(struct aldap_message *, char **, char ***);
-int aldap_free_entry(char **);
+int aldap_count_attrs(struct aldap_message *);
+int aldap_match_attr(struct aldap_message *, char *, char ***);
+int aldap_first_attr(struct aldap_message *, char **, char ***);
+int aldap_next_attr(struct aldap_message *, char **, char ***);
+int aldap_free_attr(char **);
diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c
index 942d2487ead..6814e375b73 100644
--- a/usr.sbin/ypldap/ldapclient.c
+++ b/usr.sbin/ypldap/ldapclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapclient.c,v 1.22 2011/08/28 11:53:16 aschrijver Exp $ */
+/* $OpenBSD: ldapclient.c,v 1.23 2011/08/28 16:37:28 aschrijver Exp $ */
/*
* Copyright (c) 2008 Alexander Schrijver <aschrijver@openbsd.org>
@@ -461,12 +461,12 @@ client_build_req(struct idm *idm, struct idm_req *ir, struct aldap_message *m,
GID_MAX, NULL);
}
} else if (idm->idm_list & F_LIST(i)) {
- if (aldap_match_entry(m, idm->idm_attrs[i], &ldap_attrs) == -1)
+ if (aldap_match_attr(m, idm->idm_attrs[i], &ldap_attrs) == -1)
return (-1);
if (ldap_attrs[0] == NULL)
return (-1);
for (k = 0; k >= 0 && ldap_attrs[k] != NULL; k++) {
- /* XXX: Fail when entries have ilegal characters e.g. ',' */
+ /* XXX: Fail when attributes have ilegal characters e.g. ',' */
if (strlcat(ir->ir_line, ldap_attrs[k],
sizeof(ir->ir_line)) >= sizeof(ir->ir_line))
continue;
@@ -474,19 +474,19 @@ client_build_req(struct idm *idm, struct idm_req *ir, struct aldap_message *m,
if (strlcat(ir->ir_line, ",",
sizeof(ir->ir_line))
>= sizeof(ir->ir_line)) {
- aldap_free_entry(ldap_attrs);
+ aldap_free_attr(ldap_attrs);
return (-1);
}
}
- aldap_free_entry(ldap_attrs);
+ aldap_free_attr(ldap_attrs);
} else {
- if (aldap_match_entry(m, idm->idm_attrs[i], &ldap_attrs) == -1)
+ if (aldap_match_attr(m, idm->idm_attrs[i], &ldap_attrs) == -1)
return (-1);
if (ldap_attrs[0] == NULL)
return (-1);
if (strlcat(ir->ir_line, ldap_attrs[0],
sizeof(ir->ir_line)) >= sizeof(ir->ir_line)) {
- aldap_free_entry(ldap_attrs);
+ aldap_free_attr(ldap_attrs);
return (-1);
}
if (i == ATTR_UID) {
@@ -496,7 +496,7 @@ client_build_req(struct idm *idm, struct idm_req *ir, struct aldap_message *m,
ir->ir_key.ik_uid = strtonum(
ldap_attrs[0], 0, GID_MAX, NULL);
}
- aldap_free_entry(ldap_attrs);
+ aldap_free_attr(ldap_attrs);
}
if (i + 1 != max_attr)