diff options
author | Omar Polo <op@omarpolo.com> | 2023-06-24 19:42:31 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-06-24 19:42:31 +0000 |
commit | 287ab86538ac30413fdbae20234b470b93954386 (patch) | |
tree | 305cc162f2765a6b003d0de0367bb30a069899aa | |
parent | 0fc92ad2fdb7ab7d0165812539e47a8ad2a4c3ba (diff) |
default chroot to user' home if unset
-rw-r--r-- | gmid.c | 3 | ||||
-rw-r--r-- | gmid.conf.5 | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -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 |