mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
dumpon: proceed without compression if the kernel lacks support
PR: 252554 Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34520
This commit is contained in:
parent
19837718ab
commit
2b20327ec9
|
@ -650,6 +650,15 @@ main(int argc, char *argv[])
|
|||
error = ioctl(fd, DIOCSKERNELDUMP, kdap);
|
||||
if (error != 0)
|
||||
error = errno;
|
||||
if (error == EINVAL && (gzip || zstd)) {
|
||||
/* Retry without compression in case kernel lacks support. */
|
||||
kdap->kda_compression = KERNELDUMP_COMP_NONE;
|
||||
error = ioctl(fd, DIOCSKERNELDUMP, kdap);
|
||||
if (error == 0)
|
||||
warnx("Compression disabled; kernel may lack gzip or zstd support.");
|
||||
else
|
||||
error = errno;
|
||||
}
|
||||
explicit_bzero(kdap->kda_encryptedkey, kdap->kda_encryptedkeysize);
|
||||
free(kdap->kda_encryptedkey);
|
||||
explicit_bzero(kdap, sizeof(*kdap));
|
||||
|
|
Loading…
Reference in a new issue