Drop privileges after connecting to hastd, but before sending or receiving

anything.

MFC after:	1 week
This commit is contained in:
Pawel Jakub Dawidek 2011-02-03 10:44:40 +00:00
parent f4c96f944c
commit 7cf48ac8c8

View File

@ -491,6 +491,11 @@ main(int argc, char *argv[])
pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s",
cfg->hc_controladdr);
}
if (drop_privs() != 0)
exit(EX_CONFIG);
pjdlog_debug(1, "Privileges successfully dropped.");
/* Send the command to the server... */
if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) {
pjdlog_exit(EX_UNAVAILABLE,