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
fb9efed8
Unverified
Commit
fb9efed8
authored
Jan 09, 2018
by
Christian Brauner
Committed by
GitHub
Jan 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2080 from tych0/add-idmap-parse-error-message
add some idmap parsing error messages
parents
6ddb17ff
a8b1ac78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
confile.c
src/lxc/confile.c
+3
-1
confile_utils.c
src/lxc/confile_utils.c
+13
-4
No files found.
src/lxc/confile.c
View file @
fb9efed8
...
...
@@ -1665,8 +1665,10 @@ static int set_config_idmaps(const char *key, const char *value,
memset
(
idmap
,
0
,
sizeof
(
*
idmap
));
ret
=
parse_idmaps
(
value
,
&
type
,
&
nsid
,
&
hostid
,
&
range
);
if
(
ret
<
0
)
if
(
ret
<
0
)
{
ERROR
(
"error parsing id maps"
);
goto
on_error
;
}
INFO
(
"Read uid map: type %c nsid %lu hostid %lu range %lu"
,
type
,
nsid
,
hostid
,
range
);
if
(
type
==
'u'
)
...
...
src/lxc/confile_utils.c
View file @
fb9efed8
...
...
@@ -62,8 +62,11 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
goto
on_error
;
/* Validate type. */
if
(
*
slide
!=
'u'
&&
*
slide
!=
'g'
)
if
(
*
slide
!=
'u'
&&
*
slide
!=
'g'
)
{
ERROR
(
"invalid mapping type: %c"
,
*
slide
);
goto
on_error
;
}
/* Assign type. */
tmp_type
=
*
slide
;
...
...
@@ -88,8 +91,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
*
slide
=
'\0'
;
/* Parse nsuid. */
if
(
lxc_safe_ulong
(
window
,
&
tmp_nsid
)
<
0
)
if
(
lxc_safe_ulong
(
window
,
&
tmp_nsid
)
<
0
)
{
ERROR
(
"couldn't parse nsuid: %s"
,
window
);
goto
on_error
;
}
/* Move beyond \0. */
slide
++
;
...
...
@@ -112,8 +117,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
*
slide
=
'\0'
;
/* Parse hostid. */
if
(
lxc_safe_ulong
(
window
,
&
tmp_hostid
)
<
0
)
if
(
lxc_safe_ulong
(
window
,
&
tmp_hostid
)
<
0
)
{
ERROR
(
"couldn't parse hostid: %s"
,
window
);
goto
on_error
;
}
/* Move beyond \0. */
slide
++
;
...
...
@@ -142,8 +149,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
*
slide
=
'\0'
;
/* Parse range. */
if
(
lxc_safe_ulong
(
window
,
&
tmp_range
)
<
0
)
if
(
lxc_safe_ulong
(
window
,
&
tmp_range
)
<
0
)
{
ERROR
(
"couldn't parse range: %s"
,
window
);
goto
on_error
;
}
*
type
=
tmp_type
;
*
nsid
=
tmp_nsid
;
...
...
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