diff options
author | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2018-11-04 19:24:49 +0000 |
---|---|---|
committer | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2018-11-04 19:24:49 +0000 |
commit | 377421df9690cddad7f0c8cba84bd392e62a3b6c (patch) | |
tree | 8abd5aa51822658825b9055a2be48f3f3c0b7bcb /usr.bin/rwho | |
parent | eda66948fe3eb3134f19c97689f9ca55abce8565 (diff) | |
download | src-377421df9690cddad7f0c8cba84bd392e62a3b6c.tar.gz src-377421df9690cddad7f0c8cba84bd392e62a3b6c.zip |
capsicum: use a new capsicum helpers in tools
Use caph_{rights,ioctls,fcntls}_limit to simplify the code.
Notes
Notes:
svn path=/head/; revision=340138
Diffstat (limited to 'usr.bin/rwho')
-rw-r--r-- | usr.bin/rwho/rwho.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c index 6326b2ce251a..8e6384161f28 100644 --- a/usr.bin/rwho/rwho.c +++ b/usr.bin/rwho/rwho.c @@ -129,7 +129,7 @@ main(int argc, char *argv[]) dfd = dirfd(dirp); mp = myutmp; cap_rights_init(&rights, CAP_READ, CAP_LOOKUP); - if (cap_rights_limit(dfd, &rights) < 0 && errno != ENOSYS) + if (caph_rights_limit(dfd, &rights) < 0) err(1, "cap_rights_limit failed: %s", _PATH_RWHODIR); /* * Cache files required for time(3) and localtime(3) before entering @@ -147,7 +147,7 @@ main(int argc, char *argv[]) f = openat(dfd, dp->d_name, O_RDONLY); if (f < 0) continue; - if (cap_rights_limit(f, &rights) < 0 && errno != ENOSYS) + if (caph_rights_limit(f, &rights) < 0) err(1, "cap_rights_limit failed: %s", dp->d_name); cc = read(f, (char *)&wd, sizeof(struct whod)); if (cc < WHDRSIZE) { |