Before, from the tame patch in snapshots:

$ dc /dev/null
Killed 
$

After the below patch:

$ dc /dev/null
$

Found via the regress tests.

Index: dc.c
===================================================================
RCS file: /cvs/src/usr.bin/dc/dc.c,v
retrieving revision 1.13
diff -u -p -r1.13 dc.c
--- dc.c        26 Nov 2014 18:34:51 -0000      1.13
+++ dc.c        3 Oct 2015 15:07:24 -0000
@@ -47,6 +47,8 @@ main(int argc, char *argv[])
        char            *buf, *p;
        struct stat     st;
 
+       if (tame("stdio rpath proc", NULL) == -1)
+               err(1, "tame");
 
        if ((buf = strdup("")) == NULL)
                err(1, NULL);

Reply via email to