Skip to content

Commit

Permalink
Add a manpage
Browse files Browse the repository at this point in the history
  • Loading branch information
nbraud committed May 18, 2016
1 parent b3a11a0 commit d811a8c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
a.out
no_new_privs
no_new_privs.1
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
CFLAGS = -Wall -Wextra
PREFIX = /usr/local
installables := bin/no_new_privs
export RONN_ORGANIZATION = Nicolas Braud-Santoni

installables := bin/no_new_privs man/man1/no_new_privs.1

.PHONY: clean default install uninstall
default: $(notdir $(installables))

no_new_privs: main.c
$(CC) --std=c99 -o $@ $^ $(CFLAGS) $(LDFLAGS)

%.1: %.1.md
ronn --roff $^

clean:
rm -f $(notdir $(installables))
Expand Down
33 changes: 33 additions & 0 deletions no_new_privs.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
no_new_privs(1) -- set the `NO_NEW_PRIVS` `prctl`(2)
====================================================

SYNOPSIS
--------

`no_new_privs` <program> [<arguments> ...]


DESCRIPTION
-----------

`no_new_privs` executes a program, with given arguments,
after setting the `NO_NEW_PRIVS` `prctl`(2) option.

If <program> doesn't contain a slash (/), it is searched for in a
shell-like fashion, in the `PATH` environment variable; see `execvp`(3).

EXIT STATUS
-----------

When ran successfuly, `no_new_privs` is replaced (using `execvp`(3))
by the desired program, and thus that program's exit status is used.

When ran unsuccessfuly, `no_new_privs` returns `EXIT_FAILURE`.


SEE ALSO
--------

`prctl`(2)

https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt

0 comments on commit d811a8c

Please sign in to comment.