summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-04 15:01:47 +0000
committerderaadt <deraadt@openbsd.org>2015-10-04 15:01:47 +0000
commit7d0369c1a96b4874dd10c35e3cbdd264d725628a (patch)
treeb613cf23aeaebb39784a30b3c55ea6c931ed8f0b
parentPlural. (diff)
downloadwireguard-openbsd-7d0369c1a96b4874dd10c35e3cbdd264d725628a.tar.xz
wireguard-openbsd-7d0369c1a96b4874dd10c35e3cbdd264d725628a.zip
after dd has opened it's files and done the tape positioning ioctl, we
can tame "stdio" it. ok semarie
-rw-r--r--bin/dd/dd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 715a1aa79fd..586b47b6548 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dd.c,v 1.21 2015/01/16 06:39:31 deraadt Exp $ */
+/* $OpenBSD: dd.c,v 1.22 2015/10/04 15:01:47 deraadt Exp $ */
/* $NetBSD: dd.c,v 1.6 1996/02/20 19:29:06 jtc Exp $ */
/*-
@@ -149,6 +149,9 @@ setup(void)
if (out.offset)
pos_out();
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
/*
* Truncate the output file; ignore errors because it fails on some
* kinds of output files, tapes, for example.