summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-03 03:28:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-03 03:28:36 +0000
commit7bec96735af63fb239165864ca0358e3ba16dc0e (patch)
tree79a6d25b0dc05db99dfb7fa10dde846cd72bd845 /bin
parent378b8f4accd3842cf049cf81ad2df8a2e34908e1 (diff)
right at startup, this can tame "stdio cpath rpath wpath". after getopt
-h has handled write/creating a file, we can drop to tame "stdio rpath" since md5 will only read files after that. i believe i involved lteo for this.
Diffstat (limited to 'bin')
-rw-r--r--bin/md5/md5.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c
index c039b6053de..63751cb1e18 100644
--- a/bin/md5/md5.c
+++ b/bin/md5/md5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.c,v 1.79 2015/01/19 16:43:28 deraadt Exp $ */
+/* $OpenBSD: md5.c,v 1.80 2015/10/03 03:28:35 deraadt Exp $ */
/*
* Copyright (c) 2001,2003,2005-2007,2010,2013,2014
@@ -200,6 +200,9 @@ main(int argc, char **argv)
int fl, error, base64, i;
int bflag, cflag, pflag, rflag, tflag, xflag;
+ if (tame("stdio cpath rpath wpath", NULL) == -1)
+ err(1, "tame");
+
TAILQ_INIT(&hl);
input_string = NULL;
selective_checklist = NULL;
@@ -311,6 +314,9 @@ main(int argc, char **argv)
if (ofile == NULL)
ofile = stdout;
+ if (tame("stdio rpath", NULL) != 0)
+ err(1, "tame");
+
/* Most arguments are mutually exclusive */
fl = pflag + (tflag ? 1 : 0) + xflag + cflag + (input_string != NULL);
if (fl > 1 || (fl && argc && cflag == 0) || (rflag && qflag) ||