Skip to content

Commit

Permalink
Return immediately in save_phys_nics if not run as root
Browse files Browse the repository at this point in the history
Physical nic is not instantiated in lxc_create_network

Signed-off-by: Li Qiu <li.qiu@nomovok.com>
  • Loading branch information
Li Qiu committed Dec 11, 2015
1 parent 9bfdc22 commit 40f2f8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lxc/start.c
Expand Up @@ -856,7 +856,11 @@ static int do_start(void *data)
static int save_phys_nics(struct lxc_conf *conf)
{
struct lxc_list *iterator;
int am_root = (getuid() == 0);

if (!am_root)
return 0;

lxc_list_for_each(iterator, &conf->network) {
struct lxc_netdev *netdev = iterator->elem;

Expand Down

0 comments on commit 40f2f8a

Please sign in to comment.