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
e2b02308
Unverified
Commit
e2b02308
authored
Jan 09, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: improve log messages
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0ef8bff5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
confile_utils.c
src/lxc/confile_utils.c
+9
-9
No files found.
src/lxc/confile_utils.c
View file @
e2b02308
...
@@ -60,7 +60,7 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
...
@@ -60,7 +60,7 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
/* Validate type. */
/* Validate type. */
if
(
*
slide
!=
'u'
&&
*
slide
!=
'g'
)
{
if
(
*
slide
!=
'u'
&&
*
slide
!=
'g'
)
{
ERROR
(
"
inval
id mapping type: %c"
,
*
slide
);
ERROR
(
"
Invalid
id mapping type: %c"
,
*
slide
);
goto
on_error
;
goto
on_error
;
}
}
...
@@ -77,19 +77,19 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
...
@@ -77,19 +77,19 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
if
(
slide
==
window
)
if
(
slide
==
window
)
goto
on_error
;
goto
on_error
;
/* Mark beginning of ns
u
id. */
/* Mark beginning of nsid. */
window
=
slide
;
window
=
slide
;
/* Validate that non-whitespace follows. */
/* Validate that non-whitespace follows. */
slide
+=
strcspn
(
slide
,
"
\t\r
"
);
slide
+=
strcspn
(
slide
,
"
\t\r
"
);
/* There must be non-whitespace. */
/* There must be non-whitespace. */
if
(
slide
==
window
||
*
slide
==
'\0'
)
if
(
slide
==
window
||
*
slide
==
'\0'
)
goto
on_error
;
goto
on_error
;
/* Mark end of ns
u
id. */
/* Mark end of nsid. */
*
slide
=
'\0'
;
*
slide
=
'\0'
;
/* Parse ns
u
id. */
/* Parse nsid. */
if
(
lxc_safe_ulong
(
window
,
&
tmp_nsid
)
<
0
)
{
if
(
lxc_safe_ulong
(
window
,
&
tmp_nsid
)
<
0
)
{
ERROR
(
"
couldn't parse nsu
id: %s"
,
window
);
ERROR
(
"
Failed to parse ns
id: %s"
,
window
);
goto
on_error
;
goto
on_error
;
}
}
...
@@ -110,12 +110,12 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
...
@@ -110,12 +110,12 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
/* There must be non-whitespace. */
/* There must be non-whitespace. */
if
(
slide
==
window
||
*
slide
==
'\0'
)
if
(
slide
==
window
||
*
slide
==
'\0'
)
goto
on_error
;
goto
on_error
;
/* Mark end of ns
u
id. */
/* Mark end of nsid. */
*
slide
=
'\0'
;
*
slide
=
'\0'
;
/* Parse hostid. */
/* 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
);
ERROR
(
"
Failed to
parse hostid: %s"
,
window
);
goto
on_error
;
goto
on_error
;
}
}
...
@@ -138,7 +138,7 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
...
@@ -138,7 +138,7 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
goto
on_error
;
goto
on_error
;
/* The range is the last valid entry we expect. So make sure that there
/* The range is the last valid entry we expect. So make sure that there
* is no
t
trailing garbage and if there is, error out.
* is no trailing garbage and if there is, error out.
*/
*/
if
(
*
(
slide
+
strspn
(
slide
,
"
\t\r\n
"
))
!=
'\0'
)
if
(
*
(
slide
+
strspn
(
slide
,
"
\t\r\n
"
))
!=
'\0'
)
goto
on_error
;
goto
on_error
;
...
@@ -147,7 +147,7 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
...
@@ -147,7 +147,7 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
/* Parse range. */
/* 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
);
ERROR
(
"
Failed to parse id mapping
range: %s"
,
window
);
goto
on_error
;
goto
on_error
;
}
}
...
...
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