diff options
| author | 2010-06-03 17:29:54 +0000 | |
|---|---|---|
| committer | 2010-06-03 17:29:54 +0000 | |
| commit | 21e0b42a16c836430254608255a3ffdd9a85c0f2 (patch) | |
| tree | bdb841c734771f9c02eb672ce8dc2d7155ad9ae1 /usr.sbin/ldapd/namespace.c | |
| parent | remove my BINDIR override, pointed out by deraadt@ (diff) | |
| download | wireguard-openbsd-21e0b42a16c836430254608255a3ffdd9a85c0f2.tar.xz wireguard-openbsd-21e0b42a16c836430254608255a3ffdd9a85c0f2.zip | |
Open database files before chrooting, and use an absolute path to
the database files, instead of relying on the chrooted-to path.
This breaks compaction as the ldape process can't re-open the
database files. This is being worked on.
ok gilles@
Diffstat (limited to 'usr.sbin/ldapd/namespace.c')
| -rw-r--r-- | usr.sbin/ldapd/namespace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldapd/namespace.c b/usr.sbin/ldapd/namespace.c index e6e5aa2302d..28e1e0364d5 100644 --- a/usr.sbin/ldapd/namespace.c +++ b/usr.sbin/ldapd/namespace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: namespace.c,v 1.2 2010/06/01 15:10:04 martinh Exp $ */ +/* $OpenBSD: namespace.c,v 1.3 2010/06/03 17:29:54 martinh Exp $ */ /* * Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se> @@ -116,7 +116,7 @@ namespace_open(struct namespace *ns) if (ns->sync == 0) db_flags |= BT_NOSYNC; - if (asprintf(&ns->data_path, "%s_data.db", ns->suffix) < 0) + if (asprintf(&ns->data_path, "%s/%s_data.db", DATADIR, ns->suffix) < 0) return -1; log_info("opening namespace %s", ns->suffix); ns->data_db = btree_open(ns->data_path, db_flags | BT_REVERSEKEY, 0644); @@ -125,7 +125,7 @@ namespace_open(struct namespace *ns) btree_set_cache_size(ns->data_db, ns->cache_size); - if (asprintf(&ns->indx_path, "%s_indx.db", ns->suffix) < 0) + if (asprintf(&ns->indx_path, "%s/%s_indx.db", DATADIR, ns->suffix) < 0) return -1; ns->indx_db = btree_open(ns->indx_path, db_flags, 0644); if (ns->indx_db == NULL) |
