diff options
author | 2010-06-30 17:16:09 +0000 | |
---|---|---|
committer | 2010-06-30 17:16:09 +0000 | |
commit | 901968c2eb78ee11d3d1a81291cd09d2991886ab (patch) | |
tree | 056d844a2de85d193cddf8227ff39033ca05ea72 | |
parent | Remove #ifdef CRYPTO. config will do this for us. (diff) | |
download | wireguard-openbsd-901968c2eb78ee11d3d1a81291cd09d2991886ab.tar.xz wireguard-openbsd-901968c2eb78ee11d3d1a81291cd09d2991886ab.zip |
Don't send statistics for referral namespaces. This unbreaks ldapctl stats.
Avoid null pointer dereference when reopening a namespace.
-rw-r--r-- | usr.sbin/ldapd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldapd/ldape.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/control.c b/usr.sbin/ldapd/control.c index fb3a0226e7d..a5386775bc2 100644 --- a/usr.sbin/ldapd/control.c +++ b/usr.sbin/ldapd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.3 2010/06/27 16:24:17 martinh Exp $ */ +/* $OpenBSD: control.c,v 1.4 2010/06/30 17:16:09 martinh Exp $ */ /* * Copyright (c) 2010 Martin Hedenfalk <martin@bzero.se> @@ -191,6 +191,8 @@ send_stats(struct imsgev *iev) &stats, sizeof(stats)); TAILQ_FOREACH(ns, &conf->namespaces, next) { + if (namespace_has_referrals(ns)) + continue; strlcpy(nss.suffix, ns->suffix, sizeof(nss.suffix)); st = btree_stat(ns->data_db); bcopy(st, &nss.data_stat, sizeof(nss.data_stat)); diff --git a/usr.sbin/ldapd/ldape.c b/usr.sbin/ldapd/ldape.c index 4f8c4744dd8..a663cf88f29 100644 --- a/usr.sbin/ldapd/ldape.c +++ b/usr.sbin/ldapd/ldape.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldape.c,v 1.8 2010/06/29 21:54:38 martinh Exp $ */ +/* $OpenBSD: ldape.c,v 1.9 2010/06/30 17:16:09 martinh Exp $ */ /* * Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se> @@ -463,6 +463,8 @@ ldape_open_result(struct imsg *imsg) log_debug("open(%s) returned fd %i", oreq->path, imsg->fd); TAILQ_FOREACH(ns, &conf->namespaces, next) { + if (namespace_has_referrals(ns)) + continue; if (strcmp(oreq->path, ns->data_path) == 0) { namespace_set_data_fd(ns, imsg->fd); break; |