]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Flock: container create command confusion rectified
authorMaria Matejka <mq@ucw.cz>
Sat, 5 Oct 2024 10:01:34 +0000 (12:01 +0200)
committerMaria Matejka <mq@ucw.cz>
Sun, 23 Feb 2025 18:07:35 +0000 (19:07 +0100)
flock/container.c
flock/ctl.c

index bc61c1a780d321a3566e8b079a1e4a82d6af8d30..dbf19fbad48a3642a2550b3ebabb1650098ce32e 100644 (file)
@@ -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;
 
index 3c1232b5d3ca99136279624f2ee6a11e40cbf5fe..4059208b115171376dc57eac1e5fc10d748f7363 100644 (file)
@@ -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;