Capsicum: add capability mode to users binary
Submitted by: Tyler Littlefield <tyler@tysdomain.com> Reviewed by: cem, oshogbo Differential Revision: https://reviews.freebsd.org/D9046
This commit is contained in:
parent
4222790f35
commit
47312af69a
@ -27,9 +27,12 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/capsicum.h>
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <utmpx.h>
|
||||
|
||||
#include <algorithm>
|
||||
@ -51,6 +54,10 @@ main(int argc, char **)
|
||||
}
|
||||
|
||||
setutxent();
|
||||
|
||||
if (cap_enter() < 0 && errno != ENOSYS)
|
||||
err(1, "Failed to enter capability mode.");
|
||||
|
||||
while ((ut = getutxent()) != NULL)
|
||||
if (ut->ut_type == USER_PROCESS)
|
||||
names.insert(ut->ut_user);
|
||||
|
Loading…
Reference in New Issue
Block a user