Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
0d2fe019
Commit
0d2fe019
authored
Mar 09, 2023
by
Walid Boudebouda
Committed by
Nils Goroll
Apr 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmod_unix: restrict all $Functions to client and backend
parent
0ad2601b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
unix_c00000.vtc
vmod/tests/unix_c00000.vtc
+4
-4
vmod_unix.c
vmod/vmod_unix.c
+1
-7
vmod_unix.vcc
vmod/vmod_unix.vcc
+8
-0
No files found.
vmod/tests/unix_c00000.vtc
View file @
0d2fe019
...
...
@@ -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;
...
...
vmod/vmod_unix.c
View file @
0d2fe019
...
...
@@ -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) { \
...
...
vmod/vmod_unix.vcc
View file @
0d2fe019
...
...
@@ -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
======
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment