aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-24 19:42:31 +0000
committerOmar Polo <op@omarpolo.com>2023-06-24 19:42:31 +0000
commit287ab86538ac30413fdbae20234b470b93954386 (patch)
tree305cc162f2765a6b003d0de0367bb30a069899aa
parent0fc92ad2fdb7ab7d0165812539e47a8ad2a4c3ba (diff)
default chroot to user' home if unset
-rw-r--r--gmid.c3
-rw-r--r--gmid.conf.53
2 files changed, 6 insertions, 0 deletions
diff --git a/gmid.c b/gmid.c
index b85fd4a..7d8f2c8 100644
--- a/gmid.c
+++ b/gmid.c
@@ -270,6 +270,9 @@ main(int argc, char **argv)
fatalx("need root privileges");
if ((ps->ps_pw = getpwnam(conf->user)) == NULL)
fatalx("unknown user %s", conf->user);
+ if (*conf->chroot == '\0')
+ strlcpy(conf->chroot, ps->ps_pw->pw_dir,
+ sizeof(conf->chroot));
}
ps->ps_instances[PROC_SERVER] = conf->prefork;
diff --git a/gmid.conf.5 b/gmid.conf.5
index 82e0929..f76e6d3 100644
--- a/gmid.conf.5
+++ b/gmid.conf.5
@@ -126,6 +126,9 @@ directory, except for the
and
.Ic ocsp
paths.
+Defaults to the
+.Ic user
+home directory, if provided.
.It Ic prefork Ar number
Run the specified number of server processes.
This increases the performance and prevents delays when connecting to