summaryrefslogtreecommitdiffstats
path: root/isomd5sum
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2005-04-26 17:26:03 +0000
committerPeter Jones <pjones@redhat.com>2005-04-26 17:26:03 +0000
commit005a95745351a0f3b2051f4486f692d1e4190fa8 (patch)
treeffc28bc965bf2a443596083cb9f174b30a5d8f4c /isomd5sum
parent5eed78bbcc51758fb06fd4286751d4a1250ed21f (diff)
downloadanaconda-005a95745351a0f3b2051f4486f692d1e4190fa8.tar.gz
anaconda-005a95745351a0f3b2051f4486f692d1e4190fa8.tar.xz
anaconda-005a95745351a0f3b2051f4486f692d1e4190fa8.zip
Sync the two copies of mediacheck up as much as possible
Diffstat (limited to 'isomd5sum')
-rw-r--r--isomd5sum/libcheckisomd5.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/isomd5sum/libcheckisomd5.c b/isomd5sum/libcheckisomd5.c
index 1c4056a77..fc952bcaf 100644
--- a/isomd5sum/libcheckisomd5.c
+++ b/isomd5sum/libcheckisomd5.c
@@ -37,14 +37,12 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
long long offset;
char *p;
- *supported = 0;
-
if (lseek(isofd, (off_t)(16L * 2048L), SEEK_SET) == -1)
return ((long long)-1);
offset = (16L * 2048L);
for (;1;) {
- if (read(isofd, buf, 2048) <=0)
+ if (read(isofd, buf, 2048) <= 0)
return ((long long)-1);
if (buf[0] == 1)
@@ -55,11 +53,13 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
return ((long long)-1);
offset += 2048L;
}
-
+
/* read out md5sum */
memcpy(buf2, buf + APPDATA_OFFSET, 512);
buf2[511] = '\0';
+ *supported = 0;
+
md5fnd = 0;
skipfnd = 0;
fragsumfnd = 0;
@@ -72,7 +72,7 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
/* make sure we dont walk off end */
if ((loc + 32) > 511)
return -1;
-
+
memcpy(mediasum, buf2 + loc + 13, 32);
mediasum[32] = '\0';
md5fnd = 1;
@@ -84,7 +84,7 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
/* make sure we dont walk off end */
if ((loc + 14) > 511)
return -1;
-
+
loc = loc + 14;
for (p=tmpbuf; buf2[loc] != ';' && loc < 512; p++, loc++)
*p = buf2[loc];
@@ -144,8 +144,7 @@ static int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isos
if ((skipfnd & md5fnd & fragsumfnd & fragcntfnd) & supportedfnd)
break;
}
-
-
+
if (!(skipfnd & md5fnd))
return -1;