summaryrefslogtreecommitdiffstats
path: root/sbin/md5/md5.1
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2011-11-13 16:35:47 +0000
committereadler <eadler@FreeBSD.org>2011-11-13 16:35:47 +0000
commit26f00733316ea5ae1929508c323b9ce4437bf797 (patch)
treeb40ddec192d27ae71eecb9cc2a6c5eda861a9ef0 /sbin/md5/md5.1
parentdd1ce6fd6c2c0f0c70f3c78a4959185bb93eb1c3 (diff)
downloadFreeBSD-src-26f00733316ea5ae1929508c323b9ce4437bf797.zip
FreeBSD-src-26f00733316ea5ae1929508c323b9ce4437bf797.tar.gz
- add "check" option to MD5 and friends to compare files against known hash.
PR: bin/146541 Submitted by: eadler Reviewed by: jhell@dataix.net Approved by: secteam (cperciva) Approved by: cperciva MFC after: 3 weeks
Diffstat (limited to 'sbin/md5/md5.1')
-rw-r--r--sbin/md5/md5.110
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1
index 2397d9e..c5098e4 100644
--- a/sbin/md5/md5.1
+++ b/sbin/md5/md5.1
@@ -8,18 +8,22 @@
.Sh SYNOPSIS
.Nm md5
.Op Fl pqrtx
+.Op Fl c Ar string
.Op Fl s Ar string
.Op Ar
.Nm sha1
.Op Fl pqrtx
+.Op Fl c Ar string
.Op Fl s Ar string
.Op Ar
.Nm sha256
.Op Fl pqrtx
+.Op Fl c Ar string
.Op Fl s Ar string
.Op Ar
.Nm rmd160
.Op Fl pqrtx
+.Op Fl c Ar string
.Op Fl s Ar string
.Op Ar
.Sh DESCRIPTION
@@ -73,6 +77,9 @@ precede any files named on the command line.
The hexadecimal checksum of each file listed on the command line is printed
after the options are processed.
.Bl -tag -width indent
+.It Fl c Ar string
+Compare files to this md5 string. (Note that this option is not yet useful
+if multiple files are specified.)
.It Fl s Ar string
Print a checksum of the given
.Ar string .
@@ -101,7 +108,8 @@ The
and
.Nm rmd160
utilities exit 0 on success,
-and 1 if at least one of the input files could not be read.
+1 if at least one of the input files could not be read,
+and 2 if at least one file does not have the same hash as the -c option.
.Sh SEE ALSO
.Xr cksum 1 ,
.Xr md5 3 ,
OpenPOWER on IntegriCloud