summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorian <ian@openbsd.org>2009-08-08 19:16:41 +0000
committerian <ian@openbsd.org>2009-08-08 19:16:41 +0000
commit0cc8978a25988a6e2b6243b04e4b7107ca832b8c (patch)
tree8d4ccf7a218e311d57a70acd9c005687dfc1ff1d
parentmatch 5464 / 5461 IDs found in the Linux broadcom PHY driver and unknown (diff)
downloadwireguard-openbsd-0cc8978a25988a6e2b6243b04e4b7107ca832b8c.tar.xz
wireguard-openbsd-0cc8978a25988a6e2b6243b04e4b7107ca832b8c.zip
mailq is a common sendmail alias for showing the queue; make smtpctl
implement this, ignoring sendmail options for now. OK gilles@, jackekm@
-rw-r--r--usr.sbin/smtpd/smtpctl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c
index e652986bb3a..756236d4e1e 100644
--- a/usr.sbin/smtpd/smtpctl.c
+++ b/usr.sbin/smtpd/smtpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpctl.c,v 1.32 2009/08/08 00:16:49 gilles Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.33 2009/08/08 19:16:41 ian Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -96,7 +96,12 @@ main(int argc, char *argv[])
/* parse options */
if (strcmp(__progname, "sendmail") == 0 || strcmp(__progname, "send-mail") == 0)
sendmail = 1;
- else if (strcmp(__progname, "smtpctl") == 0) {
+ else if (strcmp(__progname, "mailq") == 0) {
+ if (geteuid())
+ errx(1, "need root privileges");
+ show_queue(PATH_QUEUE, 0);
+ return 0;
+ } else if (strcmp(__progname, "smtpctl") == 0) {
/* check for root privileges */
if (geteuid())
errx(1, "need root privileges");