Index of /md5cmp/

      Name                                                                             Last modified         Size  Description
up Parent Directory 26-Nov-2020 03:53 - unknown CHECKSUM.MD5 26-Nov-2020 03:53 4k unknown Makefile 26-Nov-2020 03:53 4k [TXT] color.h 26-Nov-2020 03:53 4k [TXT] ftype.c 26-Nov-2020 03:53 4k [TXT] ftype.h 26-Nov-2020 03:53 4k [TXT] main.c 26-Nov-2020 03:53 4k [CMP] md5cmp-2.0.tar.gz 26-Nov-2020 03:53 8k [CMP] md5cmp.7.gz 26-Nov-2020 03:53 4k [TXT] md5cmp.c 26-Nov-2020 03:53 4k [TXT] md5cmp.h 26-Nov-2020 03:53 4k


Version 2.0


This program compares an MD5 hash given on the command line to the actual MD5
hash of a given file, and reports success or failure. Standard format MD5
checksum files consisting of hash and file name pairs can also be processed.

This program requires the OpenSSL 'md5.h' header file, available in the
'openssl-devel' package for the system on which it will run.


To build the 'md5cmp' binary:

	$ make

To move the 'md5cmp' binary to /usr/bin and copy the manual page file
'md5cmp.7.gz' to /usr/share/man/man7:

	$ make install

To remove the object files generated by make:

	$ make clean
To delete the installed binary and manual:

	$ make uninstall


Checking a Single File and Hash Pair

Syntax: md5cmp  

 is a lower-case MD5 hash to check against that of the provided file.

 may be a relative or absolute path to a regular file.

When verification succeeds, MD5 Compare confirms the match by displaying
"VERIFIED" along with the file name and MD5 hash, then exits with return value 0.

If verification fails, MD5 Compare reports the failure in the same manner as
described above, displaying "FAILED", and prints the correct hash on the next line,
then the program exits with return value 1.

If  does not exist or is a directory, MD5 Compare reports this, then exits
with return value 1.

Processing an MD5 Checksum File

Syntax: md5cmp [-f|--file] 

 must be a valid MD5 checksum file.

If the first line of  is not valid or the file is not found,
the program will report the corresponding error and exit with return value 1.

The program will print OK, FAILURE, or FILE NOT FOUND after each file name
as listed in the file. Before exiting (with return value 0), the program will
display the total number of files checked, total number of passed tests, and
total number of failed tests, in that order.


	$ md5cmp ee0c9c8f3814747e9582267f8d47c7d8 ~/.vimrc


		VERIFIED /home/jon/.vimrc: ee0c9c8f3814747e9582267f8d47c7d8

	$ md5cmp da297eacac0ff2f6393aef21335c4f5c ~/.vimrc


		FAILED /home/jon/.vimrc: MD5 hash da297eacac0ff2f6393aef21335c4f5c incorrect
		Correct hash: ee0c9c8f3814747e9582267f8d47c7d8

	$ md5cmp -f CHECKSUM.MD5


		color.h: OK
		ftype.c: OK
		ftype.h: OK
		main.c: OK
		Makefile: OK
		md5cmp.7.gz: OK
		md5cmp.c: OK
		md5cmp.h: OK

		9 files processed
		9 passed
		0 failed
Proudly Served by LiteSpeed Web Server at Port 443