Hello community, here is the log from the commit of package checkmedia for openSUSE:Factory checked in at Wed Jul 13 16:07:59 CEST 2011.
-------- --- checkmedia/checkmedia.changes 2010-10-12 12:06:15.000000000 +0200 +++ /mounts/work_src_done/STABLE/checkmedia/checkmedia.changes 2011-07-13 13:45:32.000000000 +0200 @@ -1,0 +2,5 @@ +Wed Jul 13 13:40:03 CEST 2011 - snw...@suse.de + +- change isohybrid md5 calculation to report 'real' md5 sum (bnc #678739) + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- checkmedia-2.4.tar.bz2 New: ---- _service:format_spec_file:checkmedia.spec checkmedia-2.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ _service:format_spec_file:checkmedia.spec ++++++ # # spec file for package checkmedia # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: checkmedia License: GPLv2+ Group: System/Management AutoReqProv: on Summary: Check Installation Media Version: 2.5 Release: 1 Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Checks installation CDs and DVDs for errors. Authors: -------- Steffen Winterfeldt %prep %setup %build make %install install -d -m 755 %{buildroot}/usr/bin install -m 755 checkmedia tagmedia %{buildroot}/usr/bin %clean rm -rf %{buildroot} %files %defattr(-,root,root) /usr/bin/checkmedia /usr/bin/tagmedia %doc README %doc COPYING %changelog ++++++ checkmedia.spec ++++++ --- /var/tmp/diff_new_pack.vPlxnq/_old 2011-07-13 16:07:27.000000000 +0200 +++ /var/tmp/diff_new_pack.vPlxnq/_new 2011-07-13 16:07:27.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package checkmedia (Version 2.4) +# spec file for package checkmedia # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,7 +23,7 @@ Group: System/Management AutoReqProv: on Summary: Check Installation Media -Version: 2.4 +Version: 2.5 Release: 1 Source: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ checkmedia-2.4.tar.bz2 -> checkmedia-2.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/checkmedia-2.4/checkmedia.c new/checkmedia-2.5/checkmedia.c --- old/checkmedia-2.4/checkmedia.c 2010-10-12 11:44:59.000000000 +0200 +++ new/checkmedia-2.5/checkmedia.c 2011-07-13 13:34:44.000000000 +0200 @@ -15,6 +15,7 @@ static void get_info(char *file, unsigned opt_verbose); static char *no_extra_spaces(char *str); static void update_progress(unsigned size); +static void check_mbr(unsigned char *mbr); struct { unsigned got_md5:1; /* got md5sum */ @@ -23,6 +24,7 @@ unsigned err:1; /* some error */ unsigned err_ofs; /* read error pos */ unsigned size; /* in kb */ + unsigned hybrid_size; /* hybrid partition, in kb */ unsigned media_nr; /* media number */ /* align md5sum buffers for int32; md5_finish_ctx() expects it */ @@ -72,22 +74,24 @@ return 1; } - printf( - " app: %s\nmedia: %s%d\n size: %u kB\n pad: %u kB\n", + printf(" app: %s\n media: %s%d\n size: %u kB\n", iso.app_id, iso.media_type, iso.media_nr ?: 1, - iso.size, - iso.pad + iso.size ); + if(iso.hybrid_size) printf("hybrid: %u kB\n", iso.hybrid_size); + + printf(" pad: %u kB\n", iso.pad); + if(iso.pad >= iso.size) { printf("wrong padding value\n"); return 1; } if(opt_verbose) { - printf(" ref: "); + printf(" ref: "); if(iso.got_old_md5) for(i = 0; i < sizeof iso.old_md5; i++) printf("%02x", iso.old_md5[i]); printf("\n"); } @@ -95,10 +99,10 @@ if(!iso.err) do_md5(argv[1]); if(iso.err && iso.err_ofs) { - printf(" err: sector %u\n", iso.err_ofs >> 1); + printf(" err: sector %u\n", iso.err_ofs >> 1); } - printf("check: "); + printf(" check: "); if(iso.got_old_md5) { if(iso.md5_ok) { printf("md5sum ok\n"); @@ -112,13 +116,13 @@ } if(iso.got_md5 && opt_verbose) { - printf(" rmd5: "); + printf(" rmd5: "); for(i = 0; i < sizeof iso.md5; i++) printf("%02x", iso.md5[i]); printf("\n"); } if(iso.got_md5) { - printf(" md5: "); + printf(" md5: "); for(i = 0; i < sizeof iso.full_md5; i++) printf("%02x", iso.full_md5[i]); printf("\n"); } @@ -145,7 +149,7 @@ if((fd = open(file, O_RDONLY | O_LARGEFILE)) == -1) return; - printf("check: "); fflush(stdout); + printf(" check: "); fflush(stdout); md5_init_ctx(&ctx); md5_init_ctx(&full_ctx); @@ -199,6 +203,17 @@ } } + if( + !err && + iso.hybrid_size > iso.size && + !iso.pad_is_skip && + (iso.hybrid_size - iso.size) < 16*1024 // allow for sane padding amounts (up to 16MB) + ) { + for(u = 0; u < ((iso.hybrid_size - iso.size) >> 1); u++) { + md5_process_block(buffer, 2 << 10, &full_ctx); + } + } + md5_finish_ctx(&ctx, iso.md5); md5_finish_ctx(&full_ctx, iso.full_md5); @@ -225,6 +240,7 @@ unsigned char buf[4]; char *s, *key, *value, *next; unsigned u, u1, idx; + unsigned char mbr[512]; memset(&iso, 0, sizeof iso); @@ -234,6 +250,8 @@ if((fd = open(file, O_RDONLY | O_LARGEFILE)) == -1) return; + if(read(fd, mbr, sizeof mbr) == sizeof mbr) check_mbr(mbr); + if( lseek(fd, 0x8028, SEEK_SET) == 0x8028 && read(fd, iso.vol_id, 32) == 32 @@ -305,7 +323,7 @@ value = no_extra_spaces(value); if(opt_verbose) { - printf(" raw: key = \"%s\", value = \"%s\"\n", key, value ?: ""); + printf(" raw: key = \"%s\", value = \"%s\"\n", key, value ?: ""); } if( @@ -340,6 +358,7 @@ } + /* * Remove leading & trailing spaces. * Modifies str! @@ -373,3 +392,22 @@ } } + +void check_mbr(unsigned char *mbr) +{ + unsigned char *p = mbr + 0x1be; // partition table + unsigned s; + + if(mbr[0x1fe] != 0x55 || mbr[0x1ff] != 0xaa) return; + + if(p[0] & 0x7f) return; + + s = p[0x0c] + (p[0x0d] << 8) + (p[0x0e] << 16) + (p[0x0f] << 24); + + if(s <= 64) return; // at least iso header + + if(s & 3) return; // 2k, really + + iso.hybrid_size = s >> 1; +} + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org