-/* $OpenBSD: enqueue.c,v 1.99 2015/10/12 21:32:27 millert Exp $ */
+/* $OpenBSD: enqueue.c,v 1.100 2015/10/13 08:06:22 gilles Exp $ */
/*
* Copyright (c) 2005 Henning Brauer <henning@bulabula.org>
/* check if working in offline mode */
/* If the server is not running, enqueue the message offline */
- if (!srv_connected())
+ if (!srv_connected()) {
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
return (enqueue_offline(save_argc, save_argv, fp, ofp));
+ }
if ((msg.fd = open_connection()) == -1)
errx(EX_UNAVAILABLE, "server too busy");
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
fout = fdopen(msg.fd, "a+");
if (fout == NULL)
err(EX_UNAVAILABLE, "fdopen");
-/* $OpenBSD: smtpctl.c,v 1.129 2015/10/12 07:58:19 deraadt Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.130 2015/10/13 08:06:22 gilles Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
if (setresgid(gid, gid, gid) == -1)
err(1, "setresgid");
+ /* we'll reduce further down the road */
+ if (pledge("stdio rpath tmppath getpw recvfd", NULL) == -1)
+ err(1, "pledge");
+
sendmail = 1;
return (enqueue(argc, argv, offlinefp));
}