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
13d8bde9
Commit
13d8bde9
authored
Dec 04, 2013
by
Seth Robertson
Committed by
Serge Hallyn
Jan 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc_unshare -u argument useful even with USER namespace shared
Signed-off-by:
Seth Robertson
<
srobertson@appcomsci.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
00fe5e1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
lxc-unshare.sgml.in
doc/lxc-unshare.sgml.in
+2
-3
lxc_unshare.c
src/lxc/lxc_unshare.c
+2
-3
No files found.
doc/lxc-unshare.sgml.in
View file @
13d8bde9
...
...
@@ -51,7 +51,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<cmdsynopsis>
<command>lxc-unshare</command>
<arg choice="req">-s <replaceable>namespaces</replaceable></arg>
<arg choice="
req
">-u <replaceable>user</replaceable></arg>
<arg choice="
opt
">-u <replaceable>user</replaceable></arg>
<arg choice="req">command</arg>
</cmdsynopsis>
</refsynopsisdiv>
...
...
@@ -100,8 +100,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</term>
<listitem>
<para>
Specify a user which the new task should become. This option is
only valid if a user namespace is unshared.
Specify a userid which the new task should become.
</para>
</listitem>
</varlistentry>
...
...
src/lxc/lxc_unshare.c
View file @
13d8bde9
...
...
@@ -97,7 +97,8 @@ static int do_start(void *arg)
int
flags
=
*
start_arg
->
flags
;
uid_t
uid
=
*
start_arg
->
uid
;
if
(
flags
&
CLONE_NEWUSER
&&
setuid
(
uid
))
{
// Setuid is useful even without a new user id space
if
(
uid
>=
0
&&
setuid
(
uid
))
{
ERROR
(
"failed to set uid %d: %s"
,
uid
,
strerror
(
errno
));
exit
(
1
);
}
...
...
@@ -153,8 +154,6 @@ int main(int argc, char *argv[])
if
(
ret
)
usage
(
argv
[
0
]);
if
(
!
(
flags
&
CLONE_NEWUSER
)
&&
uid
!=
-
1
)
{
ERROR
(
"-u <uid> needs -s USER option"
);
return
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