Commit 0d2fe019 authored by Walid Boudebouda's avatar Walid Boudebouda Committed by Nils Goroll

vmod_unix: restrict all $Functions to client and backend

parent 0ad2601b
......@@ -58,7 +58,7 @@ logexpect l1 -v v1 -d 1 -c {
} -run
varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini} {
varnish v1 -errvcl {Not available in subroutine 'vcl_init'} {
import unix;
import std;
backend b None;
......@@ -68,7 +68,7 @@ varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini
}
}
varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini} {
varnish v1 -errvcl {Not available in subroutine 'vcl_init'} {
import unix;
import std;
backend b None;
......@@ -78,7 +78,7 @@ varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini
}
}
varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini} {
varnish v1 -errvcl {Not available in subroutine 'vcl_init'} {
import unix;
import std;
backend b None;
......@@ -88,7 +88,7 @@ varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini
}
}
varnish v1 -errvcl {vmod unix failure: may not be called in vcl_init or vcl_fini} {
varnish v1 -errvcl {Not available in subroutine 'vcl_init'} {
import unix;
import std;
backend b None;
......
......@@ -49,9 +49,6 @@
#define VERR(ctx, fmt, ...) \
VSLb((ctx)->vsl, SLT_VCL_Error, "vmod unix error: " fmt, __VA_ARGS__)
#define FAILNOINIT(ctx) \
FAIL((ctx), "may not be called in vcl_init or vcl_fini")
#define ERRNOTUDS(ctx) \
ERR((ctx), "not listening on a Unix domain socket")
......@@ -93,10 +90,7 @@ vmod_##func(VRT_CTX) \
int ret; \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
if ((ctx->method & VCL_MET_TASK_H) != 0) { \
FAILNOINIT(ctx); \
return (-1); \
} \
AZ(ctx->method & VCL_MET_TASK_H); \
\
sp = get_sp(ctx); \
if (!sp->listen_sock->uds) { \
......
......@@ -67,18 +67,26 @@ $Function STRING user()
Return the user name of the peer process owner.
$Restrict client backend
$Function STRING group()
Return the group name of the peer process owner.
$Restrict client backend
$Function INT uid()
Return the numeric user id of the peer process owner.
$Restrict client backend
$Function INT gid()
Return the numeric group id of the peer process owner.
$Restrict client backend
ERRORS
======
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment