mirror of
https://github.com/opnsense/src.git
synced 2026-02-19 02:30:08 -05:00
nl(1): Capsicumise the utility
Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: markj, oshogbo MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1465 (cherry picked from commit dfd52321b7beba716fa2bdd4f54e57e9ac806e96)
This commit is contained in:
parent
a6d0bc7065
commit
6285abfcf3
1 changed files with 7 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ __COPYRIGHT(
|
|||
#include <unistd.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include <capsicum_helpers.h>
|
||||
|
||||
typedef enum {
|
||||
number_all, /* number all lines */
|
||||
number_nonempty, /* number non-empty lines */
|
||||
|
|
@ -251,6 +253,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue