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
d0fbc7ba
Unverified
Commit
d0fbc7ba
authored
Sep 03, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handler: root -> am_root
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6d8c2779
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
conf.c
src/lxc/conf.c
+1
-1
network.c
src/lxc/network.c
+6
-6
start.c
src/lxc/start.c
+4
-4
start.h
src/lxc/start.h
+1
-1
No files found.
src/lxc/conf.c
View file @
d0fbc7ba
...
@@ -3111,7 +3111,7 @@ static int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handl
...
@@ -3111,7 +3111,7 @@ static int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handl
struct
lxc_list
*
iterator
,
*
network
;
struct
lxc_list
*
iterator
,
*
network
;
int
data_sock
=
handler
->
data_sock
[
0
];
int
data_sock
=
handler
->
data_sock
[
0
];
if
(
!
handler
->
root
)
if
(
!
handler
->
am_
root
)
return
0
;
return
0
;
network
=
&
handler
->
conf
->
network
;
network
=
&
handler
->
conf
->
network
;
...
...
src/lxc/network.c
View file @
d0fbc7ba
...
@@ -2311,7 +2311,7 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
...
@@ -2311,7 +2311,7 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
char
netns_path
[
6
+
LXC_NUMSTRLEN64
+
4
+
LXC_NUMSTRLEN64
+
1
];
char
netns_path
[
6
+
LXC_NUMSTRLEN64
+
4
+
LXC_NUMSTRLEN64
+
1
];
bool
deleted_all
=
true
;
bool
deleted_all
=
true
;
if
(
handler
->
root
)
if
(
handler
->
am_
root
)
return
true
;
return
true
;
*
netns_path
=
'\0'
;
*
netns_path
=
'\0'
;
...
@@ -2389,7 +2389,7 @@ int lxc_create_network_priv(struct lxc_handler *handler)
...
@@ -2389,7 +2389,7 @@ int lxc_create_network_priv(struct lxc_handler *handler)
struct
lxc_list
*
iterator
;
struct
lxc_list
*
iterator
;
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
if
(
!
handler
->
root
)
if
(
!
handler
->
am_
root
)
return
0
;
return
0
;
lxc_list_for_each
(
iterator
,
network
)
{
lxc_list_for_each
(
iterator
,
network
)
{
...
@@ -2491,7 +2491,7 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
...
@@ -2491,7 +2491,7 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
bool
deleted_all
=
true
;
bool
deleted_all
=
true
;
if
(
!
handler
->
root
)
if
(
!
handler
->
am_
root
)
return
true
;
return
true
;
lxc_list_for_each
(
iterator
,
network
)
{
lxc_list_for_each
(
iterator
,
network
)
{
...
@@ -2622,7 +2622,7 @@ int lxc_restore_phys_nics_to_netns(struct lxc_handler *handler)
...
@@ -2622,7 +2622,7 @@ int lxc_restore_phys_nics_to_netns(struct lxc_handler *handler)
* the parent network namespace. We won't have this capability if we are
* the parent network namespace. We won't have this capability if we are
* unprivileged.
* unprivileged.
*/
*/
if
(
!
handler
->
root
)
if
(
!
handler
->
am_
root
)
return
0
;
return
0
;
TRACE
(
"Moving physical network devices back to parent network namespace"
);
TRACE
(
"Moving physical network devices back to parent network namespace"
);
...
@@ -2999,7 +2999,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
...
@@ -2999,7 +2999,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
int
data_sock
=
handler
->
data_sock
[
0
];
int
data_sock
=
handler
->
data_sock
[
0
];
if
(
handler
->
root
)
if
(
handler
->
am_
root
)
return
0
;
return
0
;
lxc_list_for_each
(
iterator
,
network
)
{
lxc_list_for_each
(
iterator
,
network
)
{
...
@@ -3030,7 +3030,7 @@ int lxc_network_recv_veth_names_from_parent(struct lxc_handler *handler)
...
@@ -3030,7 +3030,7 @@ int lxc_network_recv_veth_names_from_parent(struct lxc_handler *handler)
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
struct
lxc_list
*
network
=
&
handler
->
conf
->
network
;
int
data_sock
=
handler
->
data_sock
[
1
];
int
data_sock
=
handler
->
data_sock
[
1
];
if
(
handler
->
root
)
if
(
handler
->
am_
root
)
return
0
;
return
0
;
lxc_list_for_each
(
iterator
,
network
)
{
lxc_list_for_each
(
iterator
,
network
)
{
...
...
src/lxc/start.c
View file @
d0fbc7ba
...
@@ -539,7 +539,7 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
...
@@ -539,7 +539,7 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
* care if we are real root only if we are running as root so this
* care if we are real root only if we are running as root so this
* should be fine.
* should be fine.
*/
*/
handler
->
root
=
!
am_unpriv
();
handler
->
am_
root
=
!
am_unpriv
();
handler
->
data_sock
[
0
]
=
handler
->
data_sock
[
1
]
=
-
1
;
handler
->
data_sock
[
0
]
=
handler
->
data_sock
[
1
]
=
-
1
;
handler
->
conf
=
conf
;
handler
->
conf
=
conf
;
handler
->
lxcpath
=
lxcpath
;
handler
->
lxcpath
=
lxcpath
;
...
@@ -1062,7 +1062,7 @@ static int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *hand
...
@@ -1062,7 +1062,7 @@ static int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *hand
struct
lxc_list
*
iterator
,
*
network
;
struct
lxc_list
*
iterator
,
*
network
;
int
data_sock
=
handler
->
data_sock
[
1
];
int
data_sock
=
handler
->
data_sock
[
1
];
if
(
!
handler
->
root
)
if
(
!
handler
->
am_
root
)
return
0
;
return
0
;
network
=
&
handler
->
conf
->
network
;
network
=
&
handler
->
conf
->
network
;
...
@@ -1631,7 +1631,7 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
...
@@ -1631,7 +1631,7 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
}
}
}
}
if
(
!
handler
->
root
)
if
(
!
handler
->
am_
root
)
ret
=
userns_exec_1
(
handler
->
conf
,
lxc_rmdir_onedev_wrapper
,
ret
=
userns_exec_1
(
handler
->
conf
,
lxc_rmdir_onedev_wrapper
,
destroy
,
"lxc_rmdir_onedev_wrapper"
);
destroy
,
"lxc_rmdir_onedev_wrapper"
);
else
else
...
@@ -1651,7 +1651,7 @@ static int lxc_rmdir_onedev_wrapper(void *data)
...
@@ -1651,7 +1651,7 @@ static int lxc_rmdir_onedev_wrapper(void *data)
}
}
static
bool
do_destroy_container
(
struct
lxc_handler
*
handler
)
{
static
bool
do_destroy_container
(
struct
lxc_handler
*
handler
)
{
if
(
!
handler
->
root
)
{
if
(
!
handler
->
am_
root
)
{
if
(
userns_exec_1
(
handler
->
conf
,
storage_destroy_wrapper
,
if
(
userns_exec_1
(
handler
->
conf
,
storage_destroy_wrapper
,
handler
->
conf
,
"storage_destroy_wrapper"
)
<
0
)
handler
->
conf
,
"storage_destroy_wrapper"
)
<
0
)
return
false
;
return
false
;
...
...
src/lxc/start.h
View file @
d0fbc7ba
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include "namespace.h"
#include "namespace.h"
struct
lxc_handler
{
struct
lxc_handler
{
bool
root
;
bool
am_
root
;
pid_t
pid
;
pid_t
pid
;
char
*
name
;
char
*
name
;
lxc_state_t
state
;
lxc_state_t
state
;
...
...
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