socsvn commit: r294716 - soc2013/def/crashdump-head/sbin/decryptcore

def at FreeBSD.org def at FreeBSD.org
Tue Dec 1 22:35:11 UTC 2015


Author: def
Date: Tue Dec  1 22:35:10 2015
New Revision: 294716
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=294716

Log:
  Change decryptcore arguments.

Modified:
  soc2013/def/crashdump-head/sbin/decryptcore/decryptcore.c

Modified: soc2013/def/crashdump-head/sbin/decryptcore/decryptcore.c
==============================================================================
--- soc2013/def/crashdump-head/sbin/decryptcore/decryptcore.c	Tue Dec  1 22:14:46 2015	(r294715)
+++ soc2013/def/crashdump-head/sbin/decryptcore/decryptcore.c	Tue Dec  1 22:35:10 2015	(r294716)
@@ -23,7 +23,7 @@
 usage(void)
 {
 
-	pjdlog_exitx(1, "usage: decryptcore [-Lv] -p privatekey -k encryptedkey -i encryptedcore -o decryptedcore");
+	pjdlog_exitx(1, "usage: decryptcore [-Lv] privatekey encryptedkey encryptedcore decryptedcore");
 }
 
 static int
@@ -273,23 +273,11 @@
 	debug = 0;
 	rsakeyfile = NULL;
 	usesyslog = false;
-	while ((ch = getopt(argc, argv, "Li:k:o:p:v")) != -1) {
+	while ((ch = getopt(argc, argv, "Lv")) != -1) {
 		switch (ch) {
 		case 'L':
 			usesyslog = true;
 			break;
-		case 'i':
-			input = optarg;
-			break;
-		case 'k':
-			keyfile = optarg;
-			break;
-		case 'o':
-			output = optarg;
-			break;
-		case 'p':
-			rsakeyfile = optarg;
-			break;
 		case 'v':
 			debug++;
 			break;
@@ -300,12 +288,29 @@
 	argc -= optind;
 	argv += optind;
 
-	if (argc != 0)
+	rsakeyfile = *argv;
+	argc--;
+	argv++;
+	if (rsakeyfile == NULL)
 		usage();
-	if (input == NULL || keyfile == NULL || output == NULL ||
-	    rsakeyfile == NULL) {
+	keyfile = *argv;
+	argc--;
+	argv++;
+	if (keyfile == NULL)
+		usage();
+	input = *argv;
+	argc--;
+	argv++;
+	if (input == NULL)
+		usage();
+	output = *argv;
+	argc--;
+	argv++;
+	if (output == NULL)
+		usage();
+
+	if (argc != 0)
 		usage();
-	}
 
 	if (usesyslog)
 		pjdlog_mode_set(PJDLOG_MODE_SYSLOG);


More information about the svn-soc-all mailing list