From 03d85cd4699f1455b06ad9a3da8b868676d7d1d1 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 7 Oct 2015 15:47:56 +0000 Subject: [PATCH] tame "stdio cpath". The cpath is for rmdir(). Tame bundles all the system calls that create/destroy filesystem paths in the "cpath" request. --- bin/rmdir/rmdir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index f4d55d42f01..bac7abecca7 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rmdir.c,v 1.9 2009/10/27 23:59:22 deraadt Exp $ */ +/* $OpenBSD: rmdir.c,v 1.10 2015/10/07 15:47:56 deraadt Exp $ */ /* $NetBSD: rmdir.c,v 1.13 1995/03/21 09:08:31 cgd Exp $ */ /*- @@ -51,6 +51,9 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); + if (tame("stdio cpath", NULL) == -1) + err(1, "tame"); + pflag = 0; while ((ch = getopt(argc, argv, "p")) != -1) switch(ch) { -- 2.20.1