From dbd1640b9f41dd0699e5ac09df6f0b1f2a607bdb Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 17 Nov 2020 20:23:06 -0500 Subject: fail if the device isn't an mmcblk device --- deonebook.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 #include #include #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); } -- cgit v1.2.1