提交 56222e04 编写于 作者: J Ján Tomko

Disable nwfilter driver when running unprivileged

When opening a new connection to the driver, nwfilterOpen
only succeeds if the driverState has been allocated.

Move the privilege check in driver initialization before
the state allocation to disable the driver.

This changes the nwfilter-define error from:
error: cannot create config directory (null): Bad address
To:
this function is not supported by the connection driver:
virNWFilterDefineXML

https://bugzilla.redhat.com/show_bug.cgi?id=1029266
(cherry picked from commit b7829f95)

Conflicts:
	src/nwfilter/nwfilter_driver.c
(da77f04e Convert HAVE_DBUS to WITH_DBUS not backported)
上级 6cfc7a5d
......@@ -170,6 +170,9 @@ nwfilterDriverStartup(int privileged)
char *base = NULL;
DBusConnection *sysbus = NULL;
if (!privileged)
return 0;
#if HAVE_DBUS
sysbus = virDBusGetSystemBus();
#endif /* HAVE_DBUS */
......@@ -185,9 +188,6 @@ nwfilterDriverStartup(int privileged)
driverState->watchingFirewallD = (sysbus != NULL);
driverState->privileged = privileged;
if (!privileged)
return 0;
nwfilterDriverLock(driverState);
if (virNWFilterIPAddrMapInit() < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册