Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
2dfeec3d
Unverified
Commit
2dfeec3d
authored
Jan 04, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: add lxc_wants_cap() helper
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
1865b640
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
cgfsng.c
src/lxc/cgroups/cgfsng.c
+1
-4
conf.h
src/lxc/conf.h
+9
-0
No files found.
src/lxc/cgroups/cgfsng.c
View file @
2dfeec3d
...
@@ -1831,10 +1831,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
...
@@ -1831,10 +1831,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
}
}
if
(
!
wants_force_mount
)
{
if
(
!
wants_force_mount
)
{
if
(
!
lxc_list_empty
(
&
handler
->
conf
->
keepcaps
))
wants_force_mount
=
lxc_wants_cap
(
CAP_SYS_ADMIN
,
handler
->
conf
);
wants_force_mount
=
!
in_caplist
(
CAP_SYS_ADMIN
,
&
handler
->
conf
->
keepcaps
);
else
wants_force_mount
=
in_caplist
(
CAP_SYS_ADMIN
,
&
handler
->
conf
->
caps
);
/*
/*
* Most recent distro versions currently have init system that
* Most recent distro versions currently have init system that
...
...
src/lxc/conf.h
View file @
2dfeec3d
...
@@ -501,6 +501,15 @@ __hidden extern int run_script(const char *name, const char *section, const char
...
@@ -501,6 +501,15 @@ __hidden extern int run_script(const char *name, const char *section, const char
__hidden
extern
int
run_script_argv
(
const
char
*
name
,
unsigned
int
hook_version
,
const
char
*
section
,
__hidden
extern
int
run_script_argv
(
const
char
*
name
,
unsigned
int
hook_version
,
const
char
*
section
,
const
char
*
script
,
const
char
*
hookname
,
char
**
argsin
);
const
char
*
script
,
const
char
*
hookname
,
char
**
argsin
);
__hidden
extern
int
in_caplist
(
int
cap
,
struct
lxc_list
*
caps
);
__hidden
extern
int
in_caplist
(
int
cap
,
struct
lxc_list
*
caps
);
static
inline
int
lxc_wants_cap
(
int
cap
,
struct
lxc_conf
*
conf
)
{
if
(
!
lxc_list_empty
(
&
conf
->
keepcaps
))
return
!
in_caplist
(
cap
,
&
conf
->
keepcaps
);
return
in_caplist
(
cap
,
&
conf
->
caps
);
}
__hidden
extern
int
setup_sysctl_parameters
(
struct
lxc_list
*
sysctls
);
__hidden
extern
int
setup_sysctl_parameters
(
struct
lxc_list
*
sysctls
);
__hidden
extern
int
lxc_clear_sysctls
(
struct
lxc_conf
*
c
,
const
char
*
key
);
__hidden
extern
int
lxc_clear_sysctls
(
struct
lxc_conf
*
c
,
const
char
*
key
);
__hidden
extern
int
setup_proc_filesystem
(
struct
lxc_list
*
procs
,
pid_t
pid
);
__hidden
extern
int
setup_proc_filesystem
(
struct
lxc_list
*
procs
,
pid_t
pid
);
...
...
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