aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2024-02-16 12:37:08 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2024-02-16 12:37:41 +0000
commit17d5b027c1921d0c6ba2de7993dd808dbf4df078 (patch)
tree26937f80b4540622a0752c4ed0a9913b9b4ccb65
parent5b44edb4058365ba8e4ccfdb5176c1cddd4394fe (diff)
downloadsrc-17d5b027c1921d0c6ba2de7993dd808dbf4df078.tar.gz
src-17d5b027c1921d0c6ba2de7993dd808dbf4df078.zip
md5: Clean up input stream rights.
Keep it simple, caph_limit_stdio() and fileargs_fopen() already take care of everything for us. MFC after: 1 week Reviewed by: markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43897
-rw-r--r--sbin/md5/md5.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c
index 2045b623ff57..b6405635a5a1 100644
--- a/sbin/md5/md5.c
+++ b/sbin/md5/md5.c
@@ -574,7 +574,7 @@ main(int argc, char *argv[])
argv += optind;
#ifdef HAVE_CAPSICUM
- if (caph_limit_stdout() < 0 || caph_limit_stderr() < 0)
+ if (caph_limit_stdio() < 0)
err(1, "unable to limit rights for stdio");
#endif
@@ -629,10 +629,6 @@ main(int argc, char *argv[])
rec = rec->next;
continue;
}
-#ifdef HAVE_CAPSICUM
- if (caph_rights_limit(fileno(f), &rights) < 0)
- err(1, "capsicum");
-#endif
if (cflag && mode != mode_bsd) {
checkAgainst = rec->chksum;
rec = rec->next;
@@ -643,10 +639,6 @@ main(int argc, char *argv[])
MDOutput(&Algorithm[digest], p, filename);
} while (*++argv);
} else if (!cflag && string == NULL && !skip) {
-#ifdef HAVE_CAPSICUM
- if (caph_limit_stdin() < 0)
- err(1, "capsicum");
-#endif
if (mode == mode_bsd)
output_mode = output_bare;
p = MDInput(&Algorithm[digest], stdin, buf, pflag);