From stephen@cauchy.math.missouri.edu  Sun Jun 24 11:22:24 2001
Return-Path: <stephen@cauchy.math.missouri.edu>
Received: from cauchy.math.missouri.edu (cauchy.math.missouri.edu [128.206.49.166])
	by hub.freebsd.org (Postfix) with ESMTP id F167337B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Jun 2001 11:22:23 -0700 (PDT)
	(envelope-from stephen@cauchy.math.missouri.edu)
Received: (from stephen@localhost)
	by cauchy.math.missouri.edu (8.11.4/8.11.4) id f5OIMNe98173;
	Sun, 24 Jun 2001 13:22:23 -0500 (CDT)
	(envelope-from stephen)
Message-Id: <200106241822.f5OIMNe98173@cauchy.math.missouri.edu>
Date: Sun, 24 Jun 2001 13:22:23 -0500 (CDT)
From: Stephen Montgomery-Smith <stephen@cauchy.math.missouri.edu>
Reply-To: Stephen Montgomery-Smith <stephen@math.missouri.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: md5 -p produces 2 lines of numbers
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28386
>Category:       bin
>Synopsis:       md5 -p produces 2 lines of numbers
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 24 11:30:01 PDT 2001
>Closed-Date:    Mon Jun 25 01:54:54 PDT 2001
>Last-Modified:  Mon Jun 25 01:55:36 PDT 2001
>Originator:     Stephen Montgomery-Smith
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
University of Missouri
>Environment:
System: FreeBSD cauchy 4.3-STABLE FreeBSD 4.3-STABLE #0: Tue Jun 12 09:38:34 CDT 2001 stephen@cauchy:/usr/obj/usr/src/sys/cauchy i386


>Description:

md5 -p produces two numbers rather than one number at the end of the output.

>How-To-Repeat:

md5 -p < any_file

>Fix:

Valentin Nechayev <netch@iv.nn.kiev.ua> came up with this (posting to 
freebsd-stable and freebsd-current).  Since this is copied using cut and
paste from my mail client probably the tabs got messed up, but it is
really easy to apply by hand.

A fix:

--- md5.c.orig  Mon Jun  4 00:38:02 2001
+++ md5.c       Sun Jun 24 19:37:13 2001
@@ -65,7 +65,7 @@
                switch (ch) {
                case 'p':
                        MDFilter(1);
-                       break;
+                       exit(0);
                case 'q':
                        qflag = 1;
                        break;

This avoids determination of other options, but this does not conflict
directly with man page.

Moreover such exit(0) should be applied not only with -p, but also with
-x, -t and -s: all these options should not gather any input files.
Patch is trivial.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: dd 
Responsible-Changed-When: Sun Jun 24 11:35:07 PDT 2001 
Responsible-Changed-Why:  
Ruslan messed around with md5(1)'s argument processing recently.  I don't 
know if that's what broke it, but he should know if this is the right fix. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28386 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Mon Jun 25 01:54:54 PDT 2001 
State-Changed-Why:  
Fixed, thanks for the report! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28386 
>Unformatted:
