libvirt/src/nwfilter
Michal Privoznik 77d92e2e77 nwfilter: Partly initialize driver even for non-privileged users
https://bugzilla.redhat.com/show_bug.cgi?id=1211436

This reverts commit b7829f959b.

The previous fix was not correct. Like everywhere else, a driver is a
global variable allocated in stateInitialize function (or something
similar for stateless drivers). Later, when a driver API is called,
it's possible that the global variable is accessed and dereferenced.
Now, some drivers require root privileges because they undertake some
actions reserved only for the system admin (e.g. manipulating host
firewall). And here's the trouble, the NWFilter state initializer
exited too early when finding out it's running unprivileged, leaving
the global NWFilter driver variable uninitialized. Any subsequent
API call that tried to lock the driver resulted in dereferencing the
driver and thus crash.

On the other hand, in order to not resurrect the bug the original
commit was fixing, Let's forbid the nwfilter define in session mode.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

Conflicts:
	src/nwfilter/nwfilter_driver.c: Context. Code changed a bit
        since 2013.
2015-04-17 10:04:05 +02:00
..
nwfilter_dhcpsnoop.c Remove unnecessary curly brackets in rest of src/[a-n]*/ 2014-11-14 17:13:36 +01:00
nwfilter_dhcpsnoop.h Remove virDomainNetType parameter from nwfilter drivers 2014-04-25 15:44:09 +01:00
nwfilter_driver.c nwfilter: Partly initialize driver even for non-privileged users 2015-04-17 10:04:05 +02:00
nwfilter_driver.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_ebiptables_driver.c nwfilter: Add support for icmpv6 filtering 2015-01-07 11:41:49 -05:00
nwfilter_ebiptables_driver.h Convert nwfilter ebiptablesApplyNewRules to virFirewall 2014-04-25 15:44:10 +01:00
nwfilter_gentech_driver.c Remove unnecessary curly brackets in rest of src/[a-n]*/ 2014-11-14 17:13:36 +01:00
nwfilter_gentech_driver.h Remove virDomainNetType parameter from nwfilter drivers 2014-04-25 15:44:09 +01:00
nwfilter_learnipaddr.c Force usage of virThreadCreate 2015-03-25 10:00:53 +01:00
nwfilter_learnipaddr.h Force usage of virThreadCreate 2015-03-25 10:00:53 +01:00
nwfilter_tech_driver.h Merge nwfilter createRuleInstance driver into applyNewRules 2014-04-25 15:44:09 +01:00