From: Maria Matejka Date: Sat, 5 Oct 2024 10:01:34 +0000 (+0200) Subject: Flock: container create command confusion rectified X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53c464ca4b2e0b7b1f1d24ebf1a22dfd55918d4b;p=thirdparty%2Fbird.git Flock: container create command confusion rectified --- diff --git a/flock/container.c b/flock/container.c index bc61c1a78..dbf19fbad 100644 --- a/flock/container.c +++ b/flock/container.c @@ -362,7 +362,7 @@ container_mainloop(int fd) SYSCALL(lstat, orig, &s); if (!(s.st_mode & S_IRWXO)) { - log(L_INFO "ignoring unusable device %s", e->d_name); +// log(L_INFO "ignoring unusable device %s", e->d_name); continue; } @@ -373,7 +373,7 @@ container_mainloop(int fd) case S_IFCHR: case S_IFBLK: case S_IFREG: - log(L_INFO "bindmounting device %s", e->d_name); +// log(L_INFO "bindmounting device %s", e->d_name); SYSCALL(close, SYSCALL(open, path, O_WRONLY | O_CREAT, 0666)); int me = mount(orig, mpnt, NULL, MS_BIND, NULL); if (me < 0) @@ -386,7 +386,8 @@ container_mainloop(int fd) break; default: - log(L_INFO "ignoring device %s", e->d_name); +// log(L_INFO "ignoring device %s", e->d_name); + break; } } } @@ -1004,7 +1005,7 @@ hcf_parse(byte *buf, int size) ctx->target_len = ctx->value; break; - case 3: /* workdir */ + case 3: /* basedir */ if (ctx->type != 3) CBOR_PARSER_ERROR("Expected string, got %u", ctx->type); @@ -1012,25 +1013,25 @@ hcf_parse(byte *buf, int size) CBOR_PARSER_ERROR("Variable length string not supported yet"); if (ccf.workdir) - CBOR_PARSER_ERROR("Duplicate argument 1 / workdir"); + CBOR_PARSER_ERROR("Duplicate argument 1 / basedir"); ASSERT_DIE(!ctx->target_buf); - ccf.workdir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); + ccf.basedir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); ctx->target_len = ctx->value; break; - case 4: /* basedir */ + case 4: /* workdir */ if (ctx->type != 3) CBOR_PARSER_ERROR("Expected string, got %u", ctx->type); if (ctx->tflags & CPT_VARLEN) CBOR_PARSER_ERROR("Variable length string not supported yet"); - if (ccf.basedir) - CBOR_PARSER_ERROR("Duplicate argument 1 / basedir"); + if (ccf.workdir) + CBOR_PARSER_ERROR("Duplicate argument 2 / workdir"); ASSERT_DIE(!ctx->target_buf); - ccf.basedir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); + ccf.workdir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); ctx->target_len = ctx->value; break; diff --git a/flock/ctl.c b/flock/ctl.c index 3c1232b5d..4059208b1 100644 --- a/flock/ctl.c +++ b/flock/ctl.c @@ -188,33 +188,33 @@ hcs_parse(struct hcs_parser_context *htx, const byte *buf, s64 size) htx->major_state = 501; break; - case 504: /* machine creation argument 2: workdir */ + case 504: /* machine creation argument 2: basedir */ if (ctx->type != 2) CBOR_PARSER_ERROR("Expected bytestring, got %u", ctx->type); if (ctx->tflags & CPT_VARLEN) CBOR_PARSER_ERROR("Variable length string not supported yet"); - if (htx->cfg.container.workdir) - CBOR_PARSER_ERROR("Duplicate argument 2 / workdir"); + if (htx->cfg.container.basedir) + CBOR_PARSER_ERROR("Duplicate argument 2 / basedir"); ASSERT_DIE(!ctx->target_buf); - htx->cfg.container.workdir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); + htx->cfg.container.basedir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); ctx->target_len = ctx->value; break; - case 505: /* machine creation argument 3: basedir */ + case 505: /* machine creation argument 3: workdir */ if (ctx->type != 2) CBOR_PARSER_ERROR("Expected bytestring, got %u", ctx->type); if (ctx->tflags & CPT_VARLEN) CBOR_PARSER_ERROR("Variable length string not supported yet"); - if (htx->cfg.container.basedir) - CBOR_PARSER_ERROR("Duplicate argument 3 / basedir"); + if (htx->cfg.container.workdir) + CBOR_PARSER_ERROR("Duplicate argument 3 / workdir"); ASSERT_DIE(!ctx->target_buf); - htx->cfg.container.basedir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); + htx->cfg.container.workdir = ctx->target_buf = lp_alloc(ctx->lp, ctx->value + 1); ctx->target_len = ctx->value; break;