session: unload rpcd configuration before checking login
Currently, rpcd cached /etc/config/rpcd once on the first login and then keeps checking login attempts and ACL settings against the in-memory copy until the process is restarted. This is not desirable as we would like added, modified or removed accounts to be effective immediately. In order to achive this behaviour, ensure to unload the currently loaded rpcd configuration before looking up the login account section. Ref: https://github.com/openwrt/luci/issues/5179 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
7a560a1a57
commit
1fa35765dd
1 changed files with 6 additions and 0 deletions
|
@ -834,6 +834,12 @@ rpc_login_test_login(struct uci_context *uci,
|
|||
struct uci_element *e;
|
||||
struct uci_ptr ptr = { .package = "rpcd" };
|
||||
|
||||
if (!uci_lookup_ptr(uci, &ptr, NULL, false) && ptr.p) {
|
||||
uci_unload(uci, ptr.p);
|
||||
ptr.flags = 0;
|
||||
ptr.p = NULL;
|
||||
}
|
||||
|
||||
uci_load(uci, ptr.package, &p);
|
||||
|
||||
if (!p)
|
||||
|
|
Loading…
Reference in a new issue