Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jail error reporting is confusing #4273

Closed
nigoroll opened this issue Feb 13, 2025 · 0 comments
Closed

Jail error reporting is confusing #4273

nigoroll opened this issue Feb 13, 2025 · 0 comments

Comments

@nigoroll
Copy link
Member

i = vjt->make_workdir(dname, NULL, NULL);

if the jail implementation is present, the jail, for example

MGT_Complain(C_ERR, "Cannot create working directory '%s': %s",

generates an error message, and

ARGV_ERR("Cannot create working directory (%s): %s\n",
workdir, VAS_errtxt(errno));

on top:

$ sudo /tmp/sbin/varnishd -j unix -n /tmp/ro/workdir -a @a -b @b
Error: zCannot create working directory '/tmp/ro/workdir': Read-only file system
Error: Cannot create working directory (/tmp/ro/workdir): Success
(-? gives usage)

If the jail implementation is not present, only the error from mgt_main.c is emitted:

$ sudo /tmp/sbin/varnishd -j none -n /tmp/ro/workdir -a @a -b @b
Error: Cannot create working directory '/tmp/ro/workdir': Read-only file system
(-? gives usage)

errror message changed with this patch:

diff --git a/bin/varnishd/mgt/mgt_jail_unix.c b/bin/varnishd/mgt/mgt_jail_unix.c
index 9ca2f234b..f3a3d3a77 100644
--- a/bin/varnishd/mgt/mgt_jail_unix.c
+++ b/bin/varnishd/mgt/mgt_jail_unix.c
@@ -269,7 +269,7 @@ vju_make_workdir(const char *dname, const char *what, struct vsb *vsb)
        AZ(seteuid(0));
 
        if (mkdir(dname, 0755) < 0 && errno != EEXIST) {
-               MGT_Complain(C_ERR, "Cannot create working directory '%s': %s",
+               MGT_Complain(C_ERR, "zCannot create working directory '%s': %s",
                    dname, VAS_errtxt(errno));
                return (1);
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant