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
c5c4831c
Unverified
Commit
c5c4831c
authored
Dec 08, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: cleanup set_config_cap_drop()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
bd7c5371
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
confile.c
src/lxc/confile.c
+9
-16
No files found.
src/lxc/confile.c
View file @
c5c4831c
...
@@ -2270,16 +2270,16 @@ static int set_config_cap_keep(const char *key, const char *value,
...
@@ -2270,16 +2270,16 @@ static int set_config_cap_keep(const char *key, const char *value,
static
int
set_config_cap_drop
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_cap_drop
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
{
char
*
dropcaps
,
*
token
;
__do_free
char
*
dropcaps
=
NULL
;
struct
lxc_list
*
droplist
;
__do_free
struct
lxc_list
*
droplist
=
NULL
;
int
ret
=
-
1
;
char
*
token
;
if
(
lxc_config_value_empty
(
value
))
if
(
lxc_config_value_empty
(
value
))
return
lxc_clear_config_caps
(
lxc_conf
);
return
lxc_clear_config_caps
(
lxc_conf
);
dropcaps
=
strdup
(
value
);
dropcaps
=
strdup
(
value
);
if
(
!
dropcaps
)
if
(
!
dropcaps
)
return
-
1
;
return
ret_errno
(
ENOMEM
)
;
/* In case several capability drop is specified in a single line
/* In case several capability drop is specified in a single line
* split these caps in a single element for the list.
* split these caps in a single element for the list.
...
@@ -2287,23 +2287,16 @@ static int set_config_cap_drop(const char *key, const char *value,
...
@@ -2287,23 +2287,16 @@ static int set_config_cap_drop(const char *key, const char *value,
lxc_iterate_parts
(
token
,
dropcaps
,
"
\t
"
)
{
lxc_iterate_parts
(
token
,
dropcaps
,
"
\t
"
)
{
droplist
=
malloc
(
sizeof
(
*
droplist
));
droplist
=
malloc
(
sizeof
(
*
droplist
));
if
(
!
droplist
)
if
(
!
droplist
)
goto
on_error
;
return
ret_errno
(
ENOMEM
)
;
droplist
->
elem
=
strdup
(
token
);
droplist
->
elem
=
strdup
(
token
);
if
(
!
droplist
->
elem
)
{
if
(
!
droplist
->
elem
)
free
(
droplist
);
return
ret_errno
(
ENOMEM
);
goto
on_error
;
}
lxc_list_add_tail
(
&
lxc_conf
->
caps
,
droplist
);
lxc_list_add_tail
(
&
lxc_conf
->
caps
,
move_ptr
(
droplist
)
);
}
}
ret
=
0
;
return
0
;
on_error:
free
(
dropcaps
);
return
ret
;
}
}
static
int
set_config_console_path
(
const
char
*
key
,
const
char
*
value
,
static
int
set_config_console_path
(
const
char
*
key
,
const
char
*
value
,
...
...
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