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
a56e2df9
Unverified
Commit
a56e2df9
authored
Oct 28, 2016
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf/ile: avoid atoi in config_lsm_aa_incomplete()
Signed-off-by:
Christian Brauner
<
christian.brauner@canonical.com
>
parent
91863d36
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
conf.h
src/lxc/conf.h
+1
-1
confile.c
src/lxc/confile.c
+11
-5
No files found.
src/lxc/conf.h
View file @
a56e2df9
...
@@ -317,7 +317,7 @@ struct lxc_conf {
...
@@ -317,7 +317,7 @@ struct lxc_conf {
struct
lxc_list
hooks
[
NUM_LXC_HOOKS
];
struct
lxc_list
hooks
[
NUM_LXC_HOOKS
];
char
*
lsm_aa_profile
;
char
*
lsm_aa_profile
;
int
lsm_aa_allow_incomplete
;
unsigned
int
lsm_aa_allow_incomplete
;
char
*
lsm_se_context
;
char
*
lsm_se_context
;
int
tmp_umount_proc
;
int
tmp_umount_proc
;
char
*
seccomp
;
// filename with the seccomp rules
char
*
seccomp
;
// filename with the seccomp rules
...
...
src/lxc/confile.c
View file @
a56e2df9
...
@@ -1293,9 +1293,13 @@ static int config_lsm_aa_profile(const char *key, const char *value,
...
@@ -1293,9 +1293,13 @@ static int config_lsm_aa_profile(const char *key, const char *value,
static
int
config_lsm_aa_incomplete
(
const
char
*
key
,
const
char
*
value
,
static
int
config_lsm_aa_incomplete
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
)
struct
lxc_conf
*
lxc_conf
)
{
{
int
v
=
atoi
(
value
);
if
(
lxc_safe_uint
(
value
,
&
lxc_conf
->
lsm_aa_allow_incomplete
)
<
0
)
return
-
1
;
lxc_conf
->
lsm_aa_allow_incomplete
=
v
==
1
?
1
:
0
;
if
(
lxc_conf
->
lsm_aa_allow_incomplete
>
1
)
{
ERROR
(
"Wrong value for lxc.lsm_aa_allow_incomplete. Can only be set to 0 or 1"
);
return
-
1
;
}
return
0
;
return
0
;
}
}
...
@@ -1327,10 +1331,12 @@ static int config_loglevel(const char *key, const char *value,
...
@@ -1327,10 +1331,12 @@ static int config_loglevel(const char *key, const char *value,
if
(
!
value
||
strlen
(
value
)
==
0
)
if
(
!
value
||
strlen
(
value
)
==
0
)
return
0
;
return
0
;
if
(
value
[
0
]
>=
'0'
&&
value
[
0
]
<=
'9'
)
if
(
value
[
0
]
>=
'0'
&&
value
[
0
]
<=
'9'
)
{
newlevel
=
atoi
(
value
);
if
(
lxc_safe_int
(
value
,
&
newlevel
)
<
0
)
else
return
-
1
;
}
else
{
newlevel
=
lxc_log_priority_to_int
(
value
);
newlevel
=
lxc_log_priority_to_int
(
value
);
}
// store these values in the lxc_conf, and then try to set for
// store these values in the lxc_conf, and then try to set for
// actual current logging.
// actual current logging.
lxc_conf
->
loglevel
=
newlevel
;
lxc_conf
->
loglevel
=
newlevel
;
...
...
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