=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.216 retrieving revision 1.218 diff -u -p -r1.216 -r1.218 --- mandoc/mandocdb.c 2016/03/17 21:26:26 1.216 +++ mandoc/mandocdb.c 2016/07/12 05:18:38 1.218 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.216 2016/03/17 21:26:26 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.218 2016/07/12 05:18:38 kristaps Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2016 Ingo Schwarze @@ -33,8 +33,10 @@ #else #include "compat_fts.h" #endif -#include #include +#if HAVE_SANDBOX_INIT +#include +#endif #include #include #include @@ -342,6 +344,13 @@ mandocdb(int argc, char *argv[]) #if HAVE_PLEDGE if (pledge("stdio rpath wpath cpath fattr flock proc exec", NULL) == -1) { warn("pledge"); + return (int)MANDOCLEVEL_SYSERR; + } +#endif + +#if HAVE_SANDBOX_INIT + if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1) { + warnx("sandbox_init"); return (int)MANDOCLEVEL_SYSERR; } #endif