From owner-freebsd-stable Sun Jun 24 14:11: 5 2001 Delivered-To: freebsd-stable@freebsd.org Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by hub.freebsd.org (Postfix) with ESMTP id 1D57237B405; Sun, 24 Jun 2001 14:10:50 -0700 (PDT) (envelope-from netch@iv.nn.kiev.ua) Received: (from uucp@localhost) by segfault.kiev.ua (8) with UUCP id AEC07402; Mon, 25 Jun 2001 00:10:39 +0300 (EEST) (envelope-from netch@iv.nn.kiev.ua) Received: (from netch@localhost) by iv.nn.kiev.ua (8.11.4/8.11.4) id f5OLAKh04999; Mon, 25 Jun 2001 00:10:20 +0300 (EEST) (envelope-from netch) Date: Mon, 25 Jun 2001 00:10:20 +0300 From: Valentin Nechayev To: Stephen Montgomery-Smith , ru@freebsd.org Cc: freebsd-stable@freebsd.org, current@freebsd.org Subject: Re: Problems with md5 -p Message-ID: <20010625001020.B4663@iv.nn.kiev.ua> References: <3B35F852.2290E18F@math.missouri.edu> <20010624194339.A717@iv.nn.kiev.ua> <3B362E67.5BFC9AF2@math.missouri.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3B362E67.5BFC9AF2@math.missouri.edu>; from stephen@math.missouri.edu on Sun, Jun 24, 2001 at 01:16:07PM -0500 X-42: On Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Sun, Jun 24, 2001 at 13:16:07, stephen (Stephen Montgomery-Smith) wrote about "Re: Problems with md5 -p": > OK, I'm going to make this into a PR so that it gets fixed soon. (The > problem in stable appeared between May 19 and June 16.) Yes, it appeared with commits: ru 2001/05/22 03:33:44 PDT Modified files: sbin/md5 Makefile md5.c Removed files: sbin/md5 global.h Log: Fix argument processing. Make this compile with WARNS=2. PR: bin/27524 MFC after: 3 days Revision Changes Path 1.5 +3 -1 src/sbin/md5/Makefile 1.22 +46 -52 src/sbin/md5/md5.c ru 2001/05/26 05:08:35 PDT Modified files: (Branch: RELENG_4) sbin/md5 md5.c Removed files: (Branch: RELENG_4) sbin/md5 global.h Log: MFC: fix argument processing. Revision Changes Path 1.20.2.2 +46 -52 src/sbin/md5/md5.c Before them the case when MDFilter(0) should be called, checked separately (argc==1). After them it is not checked, "fix argument processing" is somehow wrong. IMO these commits should be reverted. > Valentin Nechayev wrote: > > > > Sun, Jun 24, 2001 at 09:25:22, stephen (Stephen Montgomery-Smith) wrote about "Problems with md5 -p": > > > > I reproduce it stably on my -current. The second checksum is constant > > and it is MD5 checksum of an empty stream: > > > > root@iv:/usr/HEAD/src/sbin/md5##md5 > d41d8cd98f00b204e9800998ecf8427e > > > > 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. > > > > > Suppose I have a file xxx. If I type > > > > > > md5 -p < xxx > > > > > > it should return the contents of the file followed by its md5 number: > > > > > > Some junk in the file > > > > > > 334911f8bcde69fe8edac561197e876f > > > > > > But now I get two numbers: > > > > > > Some junk in the file > > > > > > 334911f8bcde69fe8edac561197e876f > > > d41d8cd98f00b204e9800998ecf8427e > > > > > > This is using FreeBSD stable of June 16. (Maybe this has been fixed > > > > > more recently - please tell me of it has. It is a bit tricky for me to > > > update sources because I use CTM which has been out recently - probably > > > for just this very reason. But if I know the problem has been fixed > > > then I will go through the effort of using cvsup.) /netch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message