socsvn commit: r255398 - soc2013/def/crashdump-head/sbin/savecore

def at FreeBSD.org def at FreeBSD.org
Wed Jul 31 17:50:48 UTC 2013


Author: def
Date: Wed Jul 31 17:50:48 2013
New Revision: 255398
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=255398

Log:
  Decrypt a crash dump with a custom offset.

Modified:
  soc2013/def/crashdump-head/sbin/savecore/decryptfile.c
  soc2013/def/crashdump-head/sbin/savecore/decryptfile.h
  soc2013/def/crashdump-head/sbin/savecore/savecore.c

Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c
==============================================================================
--- soc2013/def/crashdump-head/sbin/savecore/decryptfile.c	Wed Jul 31 16:27:56 2013	(r255397)
+++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.c	Wed Jul 31 17:50:48 2013	(r255398)
@@ -57,7 +57,7 @@
 }
 
 FILE *
-dopen(const char *fname, const char *mode, const struct kerneldumpheader *h)
+dopen(const char *fname, const char *mode, const struct kerneldumpheader *h, off_t offset)
 {
 	uint8_t key[KERNELDUMP_KEY_SIZE];
 	struct xts_ctx ctx;
@@ -92,7 +92,7 @@
 	bzero(&ctx, sizeof(ctx));
 	bzero(key, KERNELDUMP_KEY_SIZE);
 
-	fd->offset = 0;
+	fd->offset = offset;
 	fd->buf_used = 0;
 
 	return (funopen(fd, NULL, dwrite, NULL, dclose));

Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.h
==============================================================================
--- soc2013/def/crashdump-head/sbin/savecore/decryptfile.h	Wed Jul 31 16:27:56 2013	(r255397)
+++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.h	Wed Jul 31 17:50:48 2013	(r255398)
@@ -18,7 +18,7 @@
 } decFile;
 
 int dwrite(void *cookie, const char *data, int size);
-FILE *dopen(const char *fname, const char *mode, const struct kerneldumpheader *h);
+FILE *dopen(const char *fname, const char *mode, const struct kerneldumpheader *h, off_t offset);
 int dclose(void *cookie);
 
 #endif /* _FILEDECRYPT_H */

Modified: soc2013/def/crashdump-head/sbin/savecore/savecore.c
==============================================================================
--- soc2013/def/crashdump-head/sbin/savecore/savecore.c	Wed Jul 31 16:27:56 2013	(r255397)
+++ soc2013/def/crashdump-head/sbin/savecore/savecore.c	Wed Jul 31 17:50:48 2013	(r255398)
@@ -634,7 +634,7 @@
 	} else if (decrypt) {
 		snprintf(corename, sizeof(corename), "%s.%d",
 		    istextdump ? "textdump.tar" : "vmcore", bounds);
-		fp = dopen(corename, "w", &kdhl);
+		fp = dopen(corename, "w", &kdhl, firsthd + sizeof(kdhf));
 	} else {
 		snprintf(corename, sizeof(corename), "%s.%d",
 		    istextdump ? "textdump.tar" : "vmcore", bounds);


More information about the svn-soc-all mailing list