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
cbaed76d
Commit
cbaed76d
authored
Dec 12, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: an int is not 1 byte
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
fef48dc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lxc_usernsexec.c
src/lxc/lxc_usernsexec.c
+8
-7
No files found.
src/lxc/lxc_usernsexec.c
View file @
cbaed76d
...
@@ -349,6 +349,7 @@ int main(int argc, char *argv[])
...
@@ -349,6 +349,7 @@ int main(int argc, char *argv[])
int
ret
;
int
ret
;
int
pid
;
int
pid
;
char
*
default_args
[]
=
{
"/bin/sh"
,
NULL
};
char
*
default_args
[]
=
{
"/bin/sh"
,
NULL
};
char
buf
[
1
];
int
pipe1
[
2
],
// child tells parent it has unshared
int
pipe1
[
2
],
// child tells parent it has unshared
pipe2
[
2
];
// parent tells child it is mapped and may proceed
pipe2
[
2
];
// parent tells child it is mapped and may proceed
...
@@ -398,16 +399,16 @@ int main(int argc, char *argv[])
...
@@ -398,16 +399,16 @@ int main(int argc, char *argv[])
perror
(
"unshare"
);
perror
(
"unshare"
);
return
1
;
return
1
;
}
}
ret
=
1
;
buf
[
0
]
=
'1'
;
if
(
write
(
pipe1
[
1
],
&
ret
,
1
)
<
1
)
{
if
(
write
(
pipe1
[
1
],
buf
,
1
)
<
1
)
{
perror
(
"write pipe"
);
perror
(
"write pipe"
);
exit
(
1
);
exit
(
1
);
}
}
if
(
read
(
pipe2
[
0
],
&
ret
,
1
)
<
1
)
{
if
(
read
(
pipe2
[
0
],
buf
,
1
)
<
1
)
{
perror
(
"read pipe"
);
perror
(
"read pipe"
);
exit
(
1
);
exit
(
1
);
}
}
if
(
ret
!=
1
)
{
if
(
buf
[
0
]
!=
'1'
)
{
fprintf
(
stderr
,
"parent had an error, child exiting
\n
"
);
fprintf
(
stderr
,
"parent had an error, child exiting
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -419,17 +420,17 @@ int main(int argc, char *argv[])
...
@@ -419,17 +420,17 @@ int main(int argc, char *argv[])
close
(
pipe1
[
1
]);
close
(
pipe1
[
1
]);
close
(
pipe2
[
0
]);
close
(
pipe2
[
0
]);
if
(
read
(
pipe1
[
0
],
&
ret
,
1
)
<
1
)
{
if
(
read
(
pipe1
[
0
],
buf
,
1
)
<
1
)
{
perror
(
"read pipe"
);
perror
(
"read pipe"
);
exit
(
1
);
exit
(
1
);
}
}
ret
=
1
;
buf
[
0
]
=
1
;
if
(
map_child_uids
(
pid
,
active_map
))
{
if
(
map_child_uids
(
pid
,
active_map
))
{
fprintf
(
stderr
,
"error mapping child
\n
"
);
fprintf
(
stderr
,
"error mapping child
\n
"
);
ret
=
0
;
ret
=
0
;
}
}
if
(
write
(
pipe2
[
1
],
&
ret
,
1
)
<
0
)
{
if
(
write
(
pipe2
[
1
],
buf
,
1
)
<
0
)
{
perror
(
"write to pipe"
);
perror
(
"write to pipe"
);
exit
(
1
);
exit
(
1
);
}
}
...
...
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