Date: Thu, 3 Feb 2011 10:44:40 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r218215 - head/sbin/hastctl Message-ID: <201102031044.p13Aieaw042802@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Thu Feb 3 10:44:40 2011 New Revision: 218215 URL: http://svn.freebsd.org/changeset/base/218215 Log: Drop privileges after connecting to hastd, but before sending or receiving anything. MFC after: 1 week Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Thu Feb 3 10:37:44 2011 (r218214) +++ head/sbin/hastctl/hastctl.c Thu Feb 3 10:44:40 2011 (r218215) @@ -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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102031044.p13Aieaw042802>