summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-11-17 20:23:06 -0500
committerJakob Kaivo <jkk@ung.org>2020-11-17 20:23:06 -0500
commitdbd1640b9f41dd0699e5ac09df6f0b1f2a607bdb (patch)
tree485a39c07c20992298680714b550c86cb099da6d
parent5c47d31929dc4b1e993d34ad557d63585bc8ac42 (diff)
fail if the device isn't an mmcblk device
-rw-r--r--deonebook.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/deonebook.c b/deonebook.c
index b4300dc..23b61ea 100644
--- a/deonebook.c
+++ b/deonebook.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 700
+#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include "deonebook.h"
@@ -36,6 +37,11 @@ int main(int argc, char *argv[])
if (optind < argc) {
device = argv[optind];
}
+ if (strstr(device, "mmcblk") != device) {
+ fprintf(stderr, "device must be an mmcblk device\n");
+ return 1;
+ }
+
key = genkey(device);
}