summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/secondary.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-01-28 22:35:46 +0000
committerpjd <pjd@FreeBSD.org>2011-01-28 22:35:46 +0000
commit621f7543a982007a0186cee91e51e29ff13e6630 (patch)
tree17c38b809107482fad50fab360dd0ff3acccc12e /sbin/hastd/secondary.c
parent1d4238ea6d7bb3df80ae2d80f0563eb3b688c32f (diff)
downloadFreeBSD-src-621f7543a982007a0186cee91e51e29ff13e6630.zip
FreeBSD-src-621f7543a982007a0186cee91e51e29ff13e6630.tar.gz
Drop privileges in worker processes.
Accepting connections and handshaking in secondary is still done before dropping privileges. It should be implemented by only accepting connections in privileged main process and passing connection descriptors to the worker, but is not implemented yet. MFC after: 1 week
Diffstat (limited to 'sbin/hastd/secondary.c')
-rw-r--r--sbin/hastd/secondary.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index 821d5c7..21b54be 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -413,6 +413,9 @@ hastd_secondary(struct hast_resource *res, struct nv *nvin)
init_local(res);
init_environment();
+ if (drop_privs() != 0)
+ exit(EX_CONFIG);
+
/*
* Create the control thread before sending any event to the parent,
* as we can deadlock when parent sends control request to worker,
OpenPOWER on IntegriCloud