aboutsummaryrefslogtreecommitdiff
path: root/bin/dd
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2018-11-04 19:24:49 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2018-11-04 19:24:49 +0000
commit377421df9690cddad7f0c8cba84bd392e62a3b6c (patch)
tree8abd5aa51822658825b9055a2be48f3f3c0b7bcb /bin/dd
parenteda66948fe3eb3134f19c97689f9ca55abce8565 (diff)
downloadsrc-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 'bin/dd')
-rw-r--r--bin/dd/dd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index a37a3072bcff..ef186a8186c3 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -157,7 +157,7 @@ setup(void)
getfdtype(&in);
cap_rights_init(&rights, CAP_READ, CAP_SEEK);
- if (cap_rights_limit(in.fd, &rights) == -1 && errno != ENOSYS)
+ if (caph_rights_limit(in.fd, &rights) == -1)
err(1, "unable to limit capability rights");
if (files_cnt > 1 && !(in.flags & ISTAPE))
@@ -188,10 +188,9 @@ setup(void)
getfdtype(&out);
- if (cap_rights_limit(out.fd, &rights) == -1 && errno != ENOSYS)
+ if (caph_rights_limit(out.fd, &rights) == -1)
err(1, "unable to limit capability rights");
- if (cap_ioctls_limit(out.fd, cmds, nitems(cmds)) == -1 &&
- errno != ENOSYS)
+ if (caph_ioctls_limit(out.fd, cmds, nitems(cmds)) == -1)
err(1, "unable to limit capability rights");
if (in.fd != STDIN_FILENO && out.fd != STDIN_FILENO) {