summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldapd
diff options
context:
space:
mode:
authormartijn <martijn@openbsd.org>2020-03-05 07:39:25 +0000
committermartijn <martijn@openbsd.org>2020-03-05 07:39:25 +0000
commit403185e43a653dece6518a28d0750f212ff40fc5 (patch)
tree6b9dee71d0f9907ec177effddec1fda53668556b /usr.sbin/ldapd
parentsync (diff)
downloadwireguard-openbsd-403185e43a653dece6518a28d0750f212ff40fc5.tar.xz
wireguard-openbsd-403185e43a653dece6518a28d0750f212ff40fc5.zip
Fix ldapd datadir location.
Diff from roklein <at> roklein <dot> de OK claudio@
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r--usr.sbin/ldapd/ldapd.c12
-rw-r--r--usr.sbin/ldapd/namespace.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/ldapd/ldapd.c b/usr.sbin/ldapd/ldapd.c
index 797a36f89f3..abf8f03524e 100644
--- a/usr.sbin/ldapd/ldapd.c
+++ b/usr.sbin/ldapd/ldapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapd.c,v 1.25 2019/03/31 03:36:18 yasuoka Exp $ */
+/* $OpenBSD: ldapd.c,v 1.26 2020/03/05 07:39:25 martijn Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -55,7 +55,7 @@ static pid_t start_child(enum ldapd_process, char *, int, int, int,
struct ldapd_stats stats;
pid_t ldape_pid;
-const char *datadir = DATADIR;
+char *datadir = DATADIR;
void
usage(void)
@@ -415,7 +415,7 @@ static pid_t
start_child(enum ldapd_process p, char *argv0, int fd, int debug,
int verbose, char *csockpath, char *conffile)
{
- char *argv[9];
+ char *argv[11];
int argc = 0;
pid_t pid;
@@ -459,7 +459,11 @@ start_child(enum ldapd_process p, char *argv0, int fd, int debug,
argv[argc++] = "-f";
argv[argc++] = conffile;
}
-
+ if (datadir) {
+ argv[argc++] = "-r";
+ argv[argc++] = datadir;
+ }
+
argv[argc++] = NULL;
execvp(argv0, argv);
diff --git a/usr.sbin/ldapd/namespace.c b/usr.sbin/ldapd/namespace.c
index 2259f57bde3..db3bb3eab02 100644
--- a/usr.sbin/ldapd/namespace.c
+++ b/usr.sbin/ldapd/namespace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: namespace.c,v 1.19 2019/06/27 18:03:37 deraadt Exp $ */
+/* $OpenBSD: namespace.c,v 1.20 2020/03/05 07:39:25 martijn Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -29,7 +29,7 @@
#include "ldapd.h"
#include "log.h"
-extern const char *datadir;
+extern char *datadir;
/* Maximum number of requests to queue per namespace during compaction.
* After this many requests, we return LDAP_BUSY.