-/* $OpenBSD: uudecode.c,v 1.20 2015/01/16 06:40:13 deraadt Exp $ */
+/* $OpenBSD: uudecode.c,v 1.21 2015/10/07 06:00:33 deraadt Exp $ */
/* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */
/*-
argc -= optind;
argv += optind;
+ if (oflag || pflag == 0) {
+ if (tame("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "tame");
+ } else {
+ if (tame("stdio rpath", NULL) == -1)
+ err(1, "tame");
+ }
+
if (*argv) {
rval = 0;
do {
-/* $OpenBSD: uuencode.c,v 1.11 2015/01/16 06:40:13 deraadt Exp $ */
+/* $OpenBSD: uuencode.c,v 1.12 2015/10/07 06:00:33 deraadt Exp $ */
/* $FreeBSD: uuencode.c,v 1.18 2004/01/22 07:23:35 grehan Exp $ */
/*-
argv += optind;
argc -= optind;
+ if (argc == 2 || outfile) {
+ if (tame("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "tame");
+ } else {
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+ }
+
switch(argc) {
case 2: /* optional first argument is input file */
if (!freopen(*argv, "r", stdin) || fstat(fileno(stdin), &sb))