rewind kafel file before using 2.4
authorRobert Swiecki <robert@swiecki.net>
Wed, 31 Jan 2018 13:40:23 +0000 (14:40 +0100)
committerRobert Swiecki <robert@swiecki.net>
Wed, 31 Jan 2018 13:40:23 +0000 (14:40 +0100)
cmdline.c
sandbox.c

index b68b0c2a29622c027c62dc7e258b1062d8b9179e..e7fe2ad24d9935c359f152b3f393e9db5d8a4c3a 100644 (file)
--- 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;
index 381849a03d30f11157f34ff8e28eee45a2971226..1a636dcfde39438f25c66bfadd56d915bf384906 100644 (file)
--- 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);