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
e456a1ef
Unverified
Commit
e456a1ef
authored
Apr 09, 2018
by
Christian Brauner
Committed by
GitHub
Apr 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2267 from brauner/QbitLogic-master
Mergeable branch for C0deAi fixes
parents
4e256f6f
d6d727af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
lxc_init.c
src/lxc/cmd/lxc_init.c
+3
-4
rsync.c
src/lxc/storage/rsync.c
+3
-1
tool_utils.c
src/lxc/tools/tool_utils.c
+4
-1
No files found.
src/lxc/cmd/lxc_init.c
View file @
e456a1ef
...
@@ -100,7 +100,6 @@ static struct arguments my_args = {
...
@@ -100,7 +100,6 @@ static struct arguments my_args = {
static
void
prevent_forking
(
void
)
static
void
prevent_forking
(
void
)
{
{
FILE
*
f
;
FILE
*
f
;
int
fd
=
-
1
;
size_t
len
=
0
;
size_t
len
=
0
;
char
*
line
=
NULL
;
char
*
line
=
NULL
;
char
path
[
MAXPATHLEN
];
char
path
[
MAXPATHLEN
];
...
@@ -110,7 +109,7 @@ static void prevent_forking(void)
...
@@ -110,7 +109,7 @@ static void prevent_forking(void)
return
;
return
;
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
while
(
getline
(
&
line
,
&
len
,
f
)
!=
-
1
)
{
int
ret
;
int
fd
,
ret
;
char
*
p
,
*
p2
;
char
*
p
,
*
p2
;
p
=
strchr
(
line
,
':'
);
p
=
strchr
(
line
,
':'
);
...
@@ -146,11 +145,11 @@ static void prevent_forking(void)
...
@@ -146,11 +145,11 @@ static void prevent_forking(void)
goto
on_error
;
goto
on_error
;
}
}
if
(
write
(
fd
,
"1"
,
1
)
!=
1
)
ret
=
write
(
fd
,
"1"
,
1
);
if
(
ret
!=
1
)
SYSERROR
(
"Failed to write to
\"
%s
\"
"
,
path
);
SYSERROR
(
"Failed to write to
\"
%s
\"
"
,
path
);
close
(
fd
);
close
(
fd
);
fd
=
-
1
;
break
;
break
;
}
}
...
...
src/lxc/storage/rsync.c
View file @
e456a1ef
...
@@ -73,8 +73,10 @@ int lxc_rsync_exec(const char *src, const char *dest)
...
@@ -73,8 +73,10 @@ int lxc_rsync_exec(const char *src, const char *dest)
return
-
1
;
return
-
1
;
ret
=
snprintf
(
s
,
l
,
"%s"
,
src
);
ret
=
snprintf
(
s
,
l
,
"%s"
,
src
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
l
)
if
(
ret
<
0
||
(
size_t
)
ret
>=
l
)
{
free
(
s
);
return
-
1
;
return
-
1
;
}
s
[
l
-
2
]
=
'/'
;
s
[
l
-
2
]
=
'/'
;
s
[
l
-
1
]
=
'\0'
;
s
[
l
-
1
]
=
'\0'
;
...
...
src/lxc/tools/tool_utils.c
View file @
e456a1ef
...
@@ -794,8 +794,11 @@ int lxc_config_define_add(struct lxc_list *defines, char *arg)
...
@@ -794,8 +794,11 @@ int lxc_config_define_add(struct lxc_list *defines, char *arg)
return
-
1
;
return
-
1
;
dent
->
elem
=
parse_line
(
arg
);
dent
->
elem
=
parse_line
(
arg
);
if
(
!
dent
->
elem
)
if
(
!
dent
->
elem
)
{
free
(
dent
);
return
-
1
;
return
-
1
;
}
lxc_list_add_tail
(
defines
,
dent
);
lxc_list_add_tail
(
defines
,
dent
);
return
0
;
return
0
;
}
}
...
...
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