summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-06-06 03:22:22 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-06-06 03:22:22 +0000
commit6de7d96816aa15934b9a2f1fdf4d673f475af1cf (patch)
treeb94fb01770c6327eb984d2e22e4a6c1b0d324408
parent034e75d22e9fec0a70df06f1255b6448c8021d6b (diff)
if smtpctl is run in unsupported mode, exit with a warning instead of
defaulting to smtpctl-mode; aja@ ok
-rw-r--r--usr.sbin/smtpd/smtpctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c
index cf71c5c168d..9751791375e 100644
--- a/usr.sbin/smtpd/smtpctl.c
+++ b/usr.sbin/smtpd/smtpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpctl.c,v 1.29 2009/05/30 16:30:33 gilles Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.30 2009/06/06 03:22:21 jacekm Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -102,7 +102,7 @@ main(int argc, char *argv[])
/* parse options */
if (strcmp(__progname, "sendmail") == 0 || strcmp(__progname, "send-mail") == 0)
sendmail = 1;
- else {
+ else if (strcmp(__progname, "smtpctl") == 0) {
/* check for root privileges */
if (geteuid())
errx(1, "need root privileges");
@@ -122,7 +122,8 @@ main(int argc, char *argv[])
goto connected;
}
return 0;
- }
+ } else
+ errx(1, "unsupported mode");
connected:
/* connect to relayd control socket */