mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Sane error message when pcap file header is wrong.
This commit is contained in:
@@ -64,9 +64,10 @@ void dump_init(void)
|
|||||||
die(_("cannot create %s: %s"), daemon->dump_file, EC_FILE);
|
die(_("cannot create %s: %s"), daemon->dump_file, EC_FILE);
|
||||||
}
|
}
|
||||||
else if ((daemon->dumpfd = open(daemon->dump_file, O_APPEND | O_RDWR)) == -1 ||
|
else if ((daemon->dumpfd = open(daemon->dump_file, O_APPEND | O_RDWR)) == -1 ||
|
||||||
!read_write(daemon->dumpfd, (void *)&header, sizeof(header), 1) ||
|
!read_write(daemon->dumpfd, (void *)&header, sizeof(header), 1))
|
||||||
header.magic_number != 0xa1b2c3d4)
|
|
||||||
die(_("cannot access %s: %s"), daemon->dump_file, EC_FILE);
|
die(_("cannot access %s: %s"), daemon->dump_file, EC_FILE);
|
||||||
|
else if (header.magic_number != 0xa1b2c3d4)
|
||||||
|
die(_("bad header in %s"), daemon->dump_file, EC_FILE);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* count existing records */
|
/* count existing records */
|
||||||
|
|||||||
Reference in New Issue
Block a user