From 6e63fd41150619dd21f5abe49065b0daa159ff51 Mon Sep 17 00:00:00 2001 From: Robert Swiecki Date: Wed, 31 Jan 2018 14:40:23 +0100 Subject: [PATCH] rewind kafel file before using --- cmdline.c | 3 ++- sandbox.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmdline.c b/cmdline.c index b68b0c2..e7fe2ad 100644 --- a/cmdline.c +++ b/cmdline.c @@ -666,7 +666,8 @@ bool cmdlineParse(int argc, char* argv[], struct nsjconf_t* nsjconf) { }; break; case 'T': { if (!mountAddMountPtTail(nsjconf, /* src= */ NULL, optarg, "tmpfs", - /* options= */ cmdlineTmpfsSz, /* flags= */ 0, /* isDir= */ NS_DIR_YES, + /* options= */ cmdlineTmpfsSz, /* flags= */ 0, + /* isDir= */ NS_DIR_YES, /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */ false)) { return false; diff --git a/sandbox.c b/sandbox.c index 381849a..1a636dc 100644 --- a/sandbox.c +++ b/sandbox.c @@ -42,6 +42,9 @@ static bool sandboxPrepareAndCommit(struct nsjconf_t* nsjconf) { kafel_ctxt_t ctxt = kafel_ctxt_create(); if (nsjconf->kafel_file != NULL) { + if (fseek(nsjconf->kafel_file, 0L, SEEK_SET) == -1) { + PLOG_W("fseek(kafel_file, 0, SEEK_SET)"); + } kafel_set_input_file(ctxt, nsjconf->kafel_file); } else { kafel_set_input_string(ctxt, nsjconf->kafel_string); -- 2.34.1