summaryrefslogtreecommitdiffstats
path: root/loader2/mediacheck.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2005-04-26 17:28:28 +0000
committerPeter Jones <pjones@redhat.com>2005-04-26 17:28:28 +0000
commitfc21a772429ff6655ba1d1c4b812ec755c2e5381 (patch)
tree97969f542dbb0113194e2fea80fda29409ee66e5 /loader2/mediacheck.c
parent005a95745351a0f3b2051f4486f692d1e4190fa8 (diff)
downloadanaconda-fc21a772429ff6655ba1d1c4b812ec755c2e5381.tar.gz
anaconda-fc21a772429ff6655ba1d1c4b812ec755c2e5381.tar.xz
anaconda-fc21a772429ff6655ba1d1c4b812ec755c2e5381.zip
add test to see if we get back a bad result from read
Diffstat (limited to 'loader2/mediacheck.c')
-rw-r--r--loader2/mediacheck.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/loader2/mediacheck.c b/loader2/mediacheck.c
index ead02a706..256f1c3ac 100644
--- a/loader2/mediacheck.c
+++ b/loader2/mediacheck.c
@@ -223,6 +223,11 @@ static int checkmd5sum(int isofd, char *mediasum, char *computedsum,
if (nread <= 0)
break;
+ if (nread > nattempt) {
+ fprintf(stderr, "Warning: read got more data than requested\n");
+ nread = nattempt;
+ lseek(isofd, offset+nread, SEEK_SET);
+ }
/* overwrite md5sum we implanted with original data */
if (offset < apoff && offset+nread >= apoff) {
appdata_start_offset = apoff - offset;