Bug 213007

Summary: [patch] sbin/md5/md5.{c,1} make '-c' flag also work with stdin, add '-P' flag to print digest to stderr
Product: Base System Reporter: Mārcis Lielturks <marcis.lielturks>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me CC: marcis.lielturks
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
sbin/md5/md5.c patch to apply '-c' to stdin input and add '-P' which outputs digest to stderr none

Description Mārcis Lielturks 2016-09-26 15:53:52 UTC
Created attachment 175182 [details]
sbin/md5/md5.c patch to apply '-c' to stdin input and add '-P' which outputs digest to stderr

I thought that extending '-c' to also verify digest, if it was passed from STDIN, would be useful and allow using md5 in pipeline. For similar reasons I added option '-P', which resembles '-p', only digest is output to STDERR.

I recently had been writing 11.0-RCx images to USB flash several times, I started to use pipeline, which fetches and writes image to USB flash directly, without intermediately storing it on computer. This, however, means that checksum verification was not straight forward.