uci: fix session delta isolation
The libuci `uci_set_savedir()` function does not replace, but appends the requested delta directory to the search path, this causes information leaks between sessions. Due to a lack of an official api for this, clear the uci contexts private delta path before setting the save directory. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
cfe1e75c91
commit
6994c87a42
1 changed files with 7 additions and 0 deletions
7
uci.c
7
uci.c
|
@ -210,8 +210,15 @@ rpc_uci_status(void)
|
|||
static void
|
||||
rpc_uci_set_savedir(struct blob_attr *sid)
|
||||
{
|
||||
struct uci_element *e, *tmp;
|
||||
char path[PATH_MAX];
|
||||
|
||||
uci_foreach_element_safe(&cursor->delta_path, tmp, e)
|
||||
free(e);
|
||||
|
||||
cursor->delta_path.prev = &cursor->delta_path;
|
||||
cursor->delta_path.next = &cursor->delta_path;
|
||||
|
||||
if (!sid)
|
||||
{
|
||||
uci_set_savedir(cursor, "/tmp/.uci");
|
||||
|
|
Loading…
Add table
Reference in a new issue