diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-01 13:05:42 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-01 13:05:42 +0000 |
commit | 932238274a0118c02785a08668dfdc479fac778a (patch) | |
tree | a7b1f953878cb872265e9588b3ffa5cacaff8686 /usr.sbin/smtpd/control.c | |
parent | a89b497936dbcf786711a7fd83a5a321b34fac8f (diff) |
deny regular users to run "smtpctl show stats" and "smtpctl schedule";
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/control.c')
-rw-r--r-- | usr.sbin/smtpd/control.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index cb89d1759c4..1472af8d7c1 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.17 2009/02/25 09:30:58 gilles Exp $ */ +/* $OpenBSD: control.c,v 1.18 2009/03/01 13:05:41 jacekm Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -355,6 +355,9 @@ control_dispatch_ext(int fd, short event, void *arg) case IMSG_STATS: { struct stats s; + if (euid) + goto badcred; + s.fd = fd; imsg_compose(env->sc_ibufs[PROC_PARENT], IMSG_STATS, 0, 0, -1, &s, sizeof(s)); imsg_compose(env->sc_ibufs[PROC_QUEUE], IMSG_STATS, 0, 0, -1, &s, sizeof(s)); @@ -366,6 +369,9 @@ control_dispatch_ext(int fd, short event, void *arg) case IMSG_RUNNER_SCHEDULE: { struct sched s; + if (euid) + goto badcred; + s = *(struct sched *)imsg.data; s.fd = fd; |