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
6f970950
Commit
6f970950
authored
Feb 25, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: Don't crash on invalid id_map
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
00903d7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
confile.c
src/lxc/confile.c
+5
-4
No files found.
src/lxc/confile.c
View file @
6f970950
...
@@ -1300,13 +1300,10 @@ static int config_idmap(const char *key, const char *value, struct lxc_conf *lxc
...
@@ -1300,13 +1300,10 @@ static int config_idmap(const char *key, const char *value, struct lxc_conf *lxc
goto
out
;
goto
out
;
memset
(
idmap
,
0
,
sizeof
(
*
idmap
));
memset
(
idmap
,
0
,
sizeof
(
*
idmap
));
idmaplist
->
elem
=
idmap
;
lxc_list_add_tail
(
&
lxc_conf
->
id_map
,
idmaplist
);
ret
=
sscanf
(
value
,
"%c %lu %lu %lu"
,
&
type
,
&
nsid
,
&
hostid
,
&
range
);
ret
=
sscanf
(
value
,
"%c %lu %lu %lu"
,
&
type
,
&
nsid
,
&
hostid
,
&
range
);
if
(
ret
!=
4
)
if
(
ret
!=
4
)
goto
out
;
goto
out
;
INFO
(
"read uid map: type %c nsid %lu hostid %lu range %lu"
,
type
,
nsid
,
hostid
,
range
);
INFO
(
"read uid map: type %c nsid %lu hostid %lu range %lu"
,
type
,
nsid
,
hostid
,
range
);
if
(
type
==
'u'
)
if
(
type
==
'u'
)
idmap
->
idtype
=
ID_TYPE_UID
;
idmap
->
idtype
=
ID_TYPE_UID
;
...
@@ -1314,10 +1311,14 @@ static int config_idmap(const char *key, const char *value, struct lxc_conf *lxc
...
@@ -1314,10 +1311,14 @@ static int config_idmap(const char *key, const char *value, struct lxc_conf *lxc
idmap
->
idtype
=
ID_TYPE_GID
;
idmap
->
idtype
=
ID_TYPE_GID
;
else
else
goto
out
;
goto
out
;
idmap
->
hostid
=
hostid
;
idmap
->
hostid
=
hostid
;
idmap
->
nsid
=
nsid
;
idmap
->
nsid
=
nsid
;
idmap
->
range
=
range
;
idmap
->
range
=
range
;
idmaplist
->
elem
=
idmap
;
lxc_list_add_tail
(
&
lxc_conf
->
id_map
,
idmaplist
);
return
0
;
return
0
;
out:
out:
...
...
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