From 40f2f8a23ef524ae82ad426b67ec3e2fcff531e2 Mon Sep 17 00:00:00 2001 From: Li Qiu Date: Fri, 11 Dec 2015 07:54:10 +0200 Subject: [PATCH] Return immediately in save_phys_nics if not run as root Physical nic is not instantiated in lxc_create_network Signed-off-by: Li Qiu --- src/lxc/start.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lxc/start.c b/src/lxc/start.c index 2606dd1d6..52315cbb5 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -856,7 +856,11 @@ out_warn_father: 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; -- 2.47.2