Commit 40f2f8a2 by Li Qiu

Return immediately in save_phys_nics if not run as root

Physical nic is not instantiated in lxc_create_network Signed-off-by: 's avatarLi Qiu <li.qiu@nomovok.com>
parent 9bfdc223
...@@ -856,6 +856,10 @@ out_warn_father: ...@@ -856,6 +856,10 @@ out_warn_father:
static int save_phys_nics(struct lxc_conf *conf) static int save_phys_nics(struct lxc_conf *conf)
{ {
struct lxc_list *iterator; struct lxc_list *iterator;
int am_root = (getuid() == 0);
if (!am_root)
return 0;
lxc_list_for_each(iterator, &conf->network) { lxc_list_for_each(iterator, &conf->network) {
struct lxc_netdev *netdev = iterator->elem; struct lxc_netdev *netdev = iterator->elem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment