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
d84b26bc
Unverified
Commit
d84b26bc
authored
Jan 04, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: fix CAP_NET_ADMIN-based mount handling
Fixes:
e8b9c9ec
("unmounted proc/sys/net if dropping CAP_NET_ADMIN") Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
309ae287
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
conf.c
src/lxc/conf.c
+2
-2
conf.h
src/lxc/conf.h
+5
-1
No files found.
src/lxc/conf.c
View file @
d84b26bc
...
...
@@ -640,8 +640,8 @@ static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_ha
{
0
,
0
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
0
}
};
bool
has_cap_net_admin
=
in_caplist
(
CAP_NET_ADMIN
,
&
conf
->
caps
);
for
(
i
=
0
;
default_mounts
[
i
].
match_mask
;
i
++
)
{
bool
has_cap_net_admin
=
lxc_wants_cap
(
CAP_NET_ADMIN
,
conf
);
for
(
i
=
0
;
default_mounts
[
i
].
match_mask
;
i
++
)
{
__do_free
char
*
destination
=
NULL
,
*
source
=
NULL
;
int
saved_errno
;
unsigned
long
mflags
;
...
...
src/lxc/conf.h
View file @
d84b26bc
...
...
@@ -15,6 +15,7 @@
#include <sys/types.h>
#include <sys/vfs.h>
#include "caps.h"
#include "compiler.h"
#include "config.h"
#include "list.h"
...
...
@@ -515,8 +516,11 @@ __hidden extern int run_script_argv(const char *name, unsigned int hook_version,
const
char
*
script
,
const
char
*
hookname
,
char
**
argsin
);
__hidden
extern
int
in_caplist
(
int
cap
,
struct
lxc_list
*
caps
);
static
inline
int
lxc_wants_cap
(
int
cap
,
struct
lxc_conf
*
conf
)
static
inline
bool
lxc_wants_cap
(
int
cap
,
struct
lxc_conf
*
conf
)
{
if
(
lxc_caps_last_cap
()
<
cap
)
return
false
;
if
(
!
lxc_list_empty
(
&
conf
->
keepcaps
))
return
!
in_caplist
(
cap
,
&
conf
->
keepcaps
);
...
...
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