Commit bedf249e authored by Natanael Copa's avatar Natanael Copa
Browse files

nlplug-findfs: fix when cryptheader is a regular file

Handle case when the crypt header is a normal file which is included in
initramfs and not a blockdevice.
parent eea062f1
......@@ -1213,6 +1213,13 @@ static void usage(int rc)
static int regular_file(const char *path)
struct stat st;
int r = stat(path, &st);
return r == -1 ? 0 : S_ISREG(st.st_mode);
int main(int argc, char *argv[])
struct pollfd fds[3];
......@@ -1262,6 +1269,12 @@ int main(int argc, char *argv[])
case 'H':
conf.crypt.header.device = EARGF(usage(1));
/* the header may be in a regular file and not a device */
if (regular_file(conf.crypt.header.device)) {
"%s", conf.crypt.header.device);
case 'h':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment