Skip to content

Commit

Permalink
rewind kafel file before using
Browse files Browse the repository at this point in the history
  • Loading branch information
robertswiecki committed Jan 31, 2018
1 parent b60d385 commit 6e63fd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6e63fd4

Please sign in to comment.