Date: Sat, 1 Sep 2012 17:37:51 +0400 From: Alexander Pyhalov <apyhalov@gmail.com> To: bug-followup@freebsd.org, pepper@reppep.com, freebsd-bugs@freebsd.org Subject: Re: bin/170278: [request] Add --check option to md5(1) Message-ID: <CALOYryGDZabFd5Caq5dKyiBb=LPniS5hbcT1p3cLUgWPuraYXA@mail.gmail.com> In-Reply-To: <CALOYryGUpEhVDawef0bL5XGzukhBqgcCzk7eURvMNZMTMLvdqg@mail.gmail.com> References: <CALOYryGUpEhVDawef0bL5XGzukhBqgcCzk7eURvMNZMTMLvdqg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--047d7b603f74d6feeb04c8a403cb Content-Type: text/plain; charset=ISO-8859-1 Hello. I''ve modified patch for md5.c, so now md5/sha256/etc handles input files containing checksums in two formats: ALGORITHM(path_to_file) = checksum and checksum path_to_file. It seems, this patch (which at least applies to md5.c in 8.3) needs testing. -- Best regards, Alexander Pyhalov --047d7b603f74d6feeb04c8a403cb Content-Type: text/plain; charset=US-ASCII; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h6kr99d31 LS0tIC91c3Ivc3JjL3NiaW4vbWQ1L21kNS5jCTIwMTItMDYtMDYgMjE6NDI6MTAuOTAxMjA4MTAx ICswNDAwCisrKyBtZDUuYwkyMDEyLTA5LTAxIDE3OjI3OjQ5Ljk1NzY1NTIyNSArMDQwMApAQCAt MjAsMTAgKzIwLDEzIEBACiAjaW5jbHVkZSA8c3lzL2NkZWZzLmg+CiBfX0ZCU0RJRCgiJEZyZWVC U0QkIik7CiAKKyNpbmNsdWRlIDxzeXMvcGFyYW0uaD4KICNpbmNsdWRlIDxzeXMvdHlwZXMuaD4K ICNpbmNsdWRlIDxzeXMvdGltZS5oPgogI2luY2x1ZGUgPHN5cy9yZXNvdXJjZS5oPgorI2luY2x1 ZGUgPGN0eXBlLmg+CiAjaW5jbHVkZSA8ZXJyLmg+CisjaW5jbHVkZSA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QkJbGVuPU1BWFBBVEhMRU47CisJ CQkJCXN0cm5jcHkoY3VyZm5hbWUsc3RyLGxlbik7CisJCQkJCWN1cmZuYW1lW2xlbi0xXT0nXDAn OworCQkJCQlzdHJuY3B5KGFsZyxBbGdvcml0aG1bZGlnZXN0XS5uYW1lLE1BWF9BTEdfTEVOR1RI KTsKKwkJCQkJcGFyc2VkPTE7CisJCQkJfQorCQkJfQorCQkJaWYocGFyc2VkICYmICFzdHJuY21w KGFsZyxBbGdvcml0aG1bZGlnZXN0XS5uYW1lLE1BWF9BTEdfTEVOR1RIKSkgeworCQkJCXAgPSBB bGdvcml0aG1bZGlnZXN0XS5GaWxlKGN1cmZuYW1lLCBidWYpOworCQkJCWlmICghcCkgewkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXJuKCIlcyIsIGN1cmZuYW1l KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAlmYWlsZWQrKzsKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKwkJCQkJaWYgKHFmbGFnKQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIiVz IiwgcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo cmZsYWcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBw cmludGYoIiVzICVzIiwgcCwgY3VyZm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHByaW50ZigiJXMgKCVzKSA9ICVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxnb3JpdGhtW2RpZ2VzdF0ubmFtZSwg Y3VyZm5hbWUsIHApOworCQkJCQlpZiAoc3RyY21wKGNoZWNrQWdhaW5zdEN1cixwKSkgeworIAkJ ICAgICAgIAkgICAgICAgICAgICAgICAgICAgY2hlY2tzRmFpbGVkKys7CisgICAgICAgICAgICAg ICAgCQkgICAgICAgICAgIGlmICghcWZsYWcpCisgICAgICAgICAgICAgICAgICAgICAgICAJCSAg ICAgICBwcmludGYoIiBbIEZhaWxlZCBdIik7CisgICAgICAgICAgICAgICAgICAgICAgICAJCX0K KwkJCQkJcHV0Y2hhcignXG4nKTsKKwkJCQl9CisJCQl9IGVsc2UgeworCQkJCSgqZmFpbGVkKSsr OworCQkJfQorCQkJYnplcm8oc3RyLE1BWF9TVFJJTkdfTEVOR1RIKTsKKyAgICAgICAgICAgICAg ICB9CisJCWZjbG9zZShmbCk7CisJfSBlbHNlIHsKKwkJKCpmYWlsZWQpKys7CisJfQorfQorCisv KgorICogIENvbnZlcnQgc3RyaW5ncyB0byB1cHBlciBjYXNlIAorICovCitzdGF0aWMgdm9pZAor c3RydG91cHBlcihjaGFyICpzKXsKKwlpbnQgaTsKKwkJCisJaWYocyl7CisJCWZvcihpPTA7c1tp XSE9J1wwJztpKyspCisJCQlzW2ldPXRvdXBwZXIoc1tpXSk7CisJfQorfQogLyoKICAqIERpZ2Vz dHMgYSBzdHJpbmcgYW5kIHByaW50cyB0aGUgcmVzdWx0LgogICovCg== --047d7b603f74d6feeb04c8a403cb--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALOYryGDZabFd5Caq5dKyiBb=LPniS5hbcT1p3cLUgWPuraYXA>