mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-07 09:26:26 +00:00
Merge pull request #719 from liqiu/li-dev2
Return immediately in save_phys_nics if not run as root
This commit is contained in:
commit
aafeda8291
@ -856,7 +856,11 @@ 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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user