[master] 522fcc577 mgt_jail: Fail if jail init fails
Nils Goroll
nils.goroll at uplex.de
Fri Feb 14 10:15:11 UTC 2025
commit 522fcc5775d53bf02f21f6991760f569a0fe73a6
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Fri Feb 14 10:52:07 2025 +0100
mgt_jail: Fail if jail init fails
Previously, we would fail at a later point with a confusing error message:
Error: linux jail: Could not disable Transparent Hugepage: Invalid argument (22)
Error:
Running VCC-compiler failed, signal 11
VCL compilation failed
(note: EINVAL was injected for testing)
diff --git a/bin/varnishd/mgt/mgt_jail.c b/bin/varnishd/mgt/mgt_jail.c
index 6d7971052..62e3967f7 100644
--- a/bin/varnishd/mgt/mgt_jail.c
+++ b/bin/varnishd/mgt/mgt_jail.c
@@ -109,7 +109,8 @@ VJ_Init(const char *j_arg)
ARGV_ERR("-j argument is empty\n");
vjt = MGT_Pick(vj_choice, av[1], "jail");
CHECK_OBJ_NOTNULL(vjt, JAIL_TECH_MAGIC);
- (void)vjt->init(av + 2);
+ if (vjt->init(av + 2))
+ ARGV_EXIT;
VAV_Free(av);
} else {
/*
More information about the varnish-commit
mailing list