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
e485b36c
Commit
e485b36c
authored
Oct 16, 2017
by
Serge Hallyn
Committed by
GitHub
Oct 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1861 from brauner/2017-10-16/fix_log_stack_smash
log: bugfixes
parents
59262374
a427e268
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
conf.c
src/lxc/conf.c
+7
-5
log.c
src/lxc/log.c
+2
-1
No files found.
src/lxc/conf.c
View file @
e485b36c
...
...
@@ -2701,9 +2701,6 @@ int lxc_map_ids(struct lxc_list *idmap, pid_t pid)
pos
+=
sprintf
(
mapbuf
,
"new%cidmap %d"
,
u_or_g
,
pid
);
lxc_list_for_each
(
iterator
,
idmap
)
{
/* The kernel only takes <= 4k for writes to
* /proc/<nr>/[ug]id_map
*/
map
=
iterator
->
elem
;
if
(
map
->
idtype
!=
type
)
continue
;
...
...
@@ -2715,8 +2712,13 @@ int lxc_map_ids(struct lxc_list *idmap, pid_t pid)
use_shadow
?
" "
:
""
,
map
->
nsid
,
map
->
hostid
,
map
->
range
,
use_shadow
?
""
:
"
\n
"
);
if
(
fill
<=
0
||
fill
>=
left
)
SYSERROR
(
"Too many {g,u}id mappings defined."
);
if
(
fill
<=
0
||
fill
>=
left
)
{
/* The kernel only takes <= 4k for writes to
* /proc/<pid>/{g,u}id_map
*/
SYSERROR
(
"Too many %cid mappings defined"
,
u_or_g
);
return
-
1
;
}
pos
+=
fill
;
}
...
...
src/lxc/log.c
View file @
e485b36c
...
...
@@ -297,7 +297,8 @@ static int log_append_logfile(const struct lxc_log_appender *appender,
if
((
size_t
)
n
<
(
sizeof
(
buffer
)
-
1
))
n
+=
vsnprintf
(
buffer
+
n
,
sizeof
(
buffer
)
-
n
,
event
->
fmt
,
*
event
->
vap
);
else
if
((
size_t
)
n
>=
sizeof
(
buffer
))
n
=
sizeof
(
buffer
)
-
1
;
buffer
[
n
]
=
'\n'
;
...
...
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