uci: switch to proper save directory on apply/rollback
authorJo-Philipp Wich <jo@mein.io>
Thu, 19 Apr 2018 12:02:30 +0000 (14:02 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 20 Apr 2018 11:15:46 +0000 (13:15 +0200)
commit24231622340bf563cc89d2ae384a043a59cb994b
treeb6d39a40236e305d689185fc253e92466875f015
parentedd37f8dbbeb5d971eb0f01f071ae45c0312b779
uci: switch to proper save directory on apply/rollback

The existing code failed to set the uci cursor save directory to the current
session path, causing the apply routine to either fail or to merge settings
from unrelated neighboring sessions, potentially leaking data.

Solve the issue by switching the uci cursor save directory to the session
directory before performing the actual apply actions.

Additionally set the save directory path to "/dev/null" during rollback, to
avoid merging unrelated system wide uci changes when restoring configs from
the snapshot directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
uci.c