diff --git a/usr.bin/nl/nl.c b/usr.bin/nl/nl.c index a6a14239f582e6..573e03e4ad0d30 100644 --- a/usr.bin/nl/nl.c +++ b/usr.bin/nl/nl.c @@ -42,6 +42,8 @@ #include #include +#include + typedef enum { number_all, /* number all lines */ number_nonempty, /* number non-empty lines */ @@ -244,6 +246,11 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + /* Limit standard descriptors and enter capability mode */ + caph_cache_catpages(); + if (caph_limit_stdio() < 0 || caph_enter() < 0) + err(EXIT_FAILURE, "capsicum"); + /* Generate the delimiter sequence */ memcpy(delim, delim1, delim1len); memcpy(delim + delim1len, delim2, delim2len);