From: schwarze Date: Fri, 16 Oct 2015 21:35:16 +0000 (+0000) Subject: Once apropos(1) or man(1) are done with database access, or if the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=779d88a99c8c25ae3c25d9a5f2715e0344d141a0;p=openbsd Once apropos(1) or man(1) are done with database access, or if the program was called as mandoc(1) in the first place, remove "flock" from our pledge(2) before entering the parsers and formatters. OK millert@ deraadt@ --- diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c index 07edb8c36b5..f62bca14ad8 100644 --- a/usr.bin/mandoc/main.c +++ b/usr.bin/mandoc/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.156 2015/10/16 13:37:44 millert Exp $ */ +/* $OpenBSD: main.c,v 1.157 2015/10/16 21:35:16 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -394,6 +394,10 @@ main(int argc, char *argv[]) /* mandoc(1) */ + if (pledge(use_pager ? "stdio rpath tmppath proc exec" : + "stdio rpath", NULL) == -1) + err(1, "pledge"); + if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths)) return (int)MANDOCLEVEL_BADARG;