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
1b04343a
Unverified
Commit
1b04343a
authored
May 29, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jail enum assertions
parent
d2c1b12b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
mgt.h
bin/varnishd/mgt/mgt.h
+10
-0
mgt_jail_unix.c
bin/varnishd/mgt/mgt_jail_unix.c
+2
-0
No files found.
bin/varnishd/mgt/mgt.h
View file @
1b04343a
...
...
@@ -110,6 +110,11 @@ enum jail_master_e {
JAIL_MASTER_KILL
,
};
#define ASSERT_JAIL_MASTER(x) do { \
assert(x >= JAIL_MASTER_LOW); \
assert(x <= JAIL_MASTER_KILL); \
} while (0)
enum
jail_subproc_e
{
JAIL_SUBPROC_VCC
=
JAIL_MASTER_KILL
+
1
,
JAIL_SUBPROC_CC
,
...
...
@@ -117,6 +122,11 @@ enum jail_subproc_e {
JAIL_SUBPROC_WORKER
,
};
#define ASSERT_JAIL_SUBPROC(x) do { \
assert(x >= JAIL_SUBPROC_VCC); \
assert(x <= JAIL_SUBPROC_WORKER); \
} while (0)
#define JAIL_LIMIT (JAIL_SUBPROC_WORKER + 1)
enum
jail_fixfd_e
{
...
...
bin/varnishd/mgt/mgt_jail_unix.c
View file @
1b04343a
...
...
@@ -188,6 +188,7 @@ vju_init(char **args)
static
void
v_matchproto_
(
jail_master_f
)
vju_master
(
enum
jail_master_e
jme
)
{
ASSERT_JAIL_MASTER
(
jme
);
if
(
jme
==
JAIL_MASTER_LOW
)
{
AZ
(
setegid
(
vju_gid
));
AZ
(
seteuid
(
vju_uid
));
...
...
@@ -203,6 +204,7 @@ vju_subproc(enum jail_subproc_e jse)
int
i
;
gid_t
gid_list
[
NGID
];
ASSERT_JAIL_SUBPROC
(
jse
);
AZ
(
seteuid
(
0
));
if
(
vju_wrkuser
!=
NULL
&&
(
jse
==
JAIL_SUBPROC_VCLLOAD
||
jse
==
JAIL_SUBPROC_WORKER
))
{
...
...
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