Skip to content

Commit

Permalink
app-emulation/qemu: Bugfix: Fix patch file
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.6, Repoman-2.3.3
  • Loading branch information
tamiko committed Jul 26, 2017
1 parent a17d5f5 commit 07b6f99
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app-emulation/qemu/files/qemu-2.9.0-CVE-2017-7539.patch
Original file line number Diff line number Diff line change
Expand Up @@ -375,25 +375,25 @@ index 924a1fe..a1f106b 100644

magic = cpu_to_be64(NBD_REP_MAGIC);
- if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) != sizeof(magic)) {
+ if (nbd_write(ioc, &magic, sizeof(magic), NULL) < 0) {
+ if (write_sync(ioc, &magic, sizeof(magic), NULL) < 0) {
LOG("write failed (rep magic)");
return -EINVAL;
}
opt = cpu_to_be32(opt);
- if (nbd_negotiate_write(ioc, &opt, sizeof(opt)) != sizeof(opt)) {
+ if (nbd_write(ioc, &opt, sizeof(opt), NULL) < 0) {
+ if (write_sync(ioc, &opt, sizeof(opt), NULL) < 0) {
LOG("write failed (rep opt)");
return -EINVAL;
}
type = cpu_to_be32(type);
- if (nbd_negotiate_write(ioc, &type, sizeof(type)) != sizeof(type)) {
+ if (nbd_write(ioc, &type, sizeof(type), NULL) < 0) {
+ if (write_sync(ioc, &type, sizeof(type), NULL) < 0) {
LOG("write failed (rep type)");
return -EINVAL;
}
len = cpu_to_be32(len);
- if (nbd_negotiate_write(ioc, &len, sizeof(len)) != sizeof(len)) {
+ if (nbd_write(ioc, &len, sizeof(len), NULL) < 0) {
+ if (write_sync(ioc, &len, sizeof(len), NULL) < 0) {
LOG("write failed (rep data length)");
return -EINVAL;
}
Expand All @@ -402,7 +402,7 @@ index 924a1fe..a1f106b 100644
goto out;
}
- if (nbd_negotiate_write(ioc, msg, len) != len) {
+ if (nbd_write(ioc, msg, len, NULL) < 0) {
+ if (write_sync(ioc, msg, len, NULL) < 0) {
LOG("write failed (error message)");
ret = -EIO;
} else {
Expand All @@ -411,17 +411,17 @@ index 924a1fe..a1f106b 100644

len = cpu_to_be32(name_len);
- if (nbd_negotiate_write(ioc, &len, sizeof(len)) != sizeof(len)) {
+ if (nbd_write(ioc, &len, sizeof(len), NULL) < 0) {
+ if (write_sync(ioc, &len, sizeof(len), NULL) < 0) {
LOG("write failed (name length)");
return -EINVAL;
}
- if (nbd_negotiate_write(ioc, name, name_len) != name_len) {
+ if (nbd_write(ioc, name, name_len, NULL) < 0) {
+ if (write_sync(ioc, name, name_len, NULL) < 0) {
LOG("write failed (name buffer)");
return -EINVAL;
}
- if (nbd_negotiate_write(ioc, desc, desc_len) != desc_len) {
+ if (nbd_write(ioc, desc, desc_len, NULL) < 0) {
+ if (write_sync(ioc, desc, desc_len, NULL) < 0) {
LOG("write failed (description buffer)");
return -EINVAL;
}
Expand Down Expand Up @@ -524,13 +524,13 @@ index 924a1fe..a1f106b 100644
goto fail;
}
- if (nbd_negotiate_write(client->ioc, buf, sizeof(buf)) != sizeof(buf)) {
+ if (nbd_write(client->ioc, buf, sizeof(buf), NULL) < 0) {
+ if (write_sync(client->ioc, buf, sizeof(buf), NULL) < 0) {
LOG("write failed");
goto fail;
}
} else {
- if (nbd_negotiate_write(client->ioc, buf, 18) != 18) {
+ if (nbd_write(client->ioc, buf, 18, NULL) < 0) {
+ if (write_sync(client->ioc, buf, 18, NULL) < 0) {
LOG("write failed");
goto fail;
}
Expand All @@ -539,7 +539,7 @@ index 924a1fe..a1f106b 100644
stw_be_p(buf + 26, client->exp->nbdflags | myflags);
len = client->no_zeroes ? 10 : sizeof(buf) - 18;
- if (nbd_negotiate_write(client->ioc, buf + 18, len) != len) {
+ if (nbd_write(client->ioc, buf + 18, len, NULL) < 0) {
+ if (write_sync(client->ioc, buf + 18, len, NULL) < 0) {
LOG("write failed");
goto fail;
}
Expand Down

0 comments on commit 07b6f99

Please sign in to comment.