main: only purge uci savedirs if not reloading
[project/rpcd.git] / luci2.c
diff --git a/luci2.c b/luci2.c
index bb68a4b..f136c56 100644 (file)
--- a/luci2.c
+++ b/luci2.c
@@ -1,5 +1,5 @@
 /*
- * luci-rpcd - LuCI UBUS RPC server
+ * rpcd - UBUS RPC server
  *
  *   Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
  *
 #include <arpa/inet.h>
 #include <signal.h>
 #include <glob.h>
+#include <libubox/blobmsg_json.h>
+#include <libubus.h>
+#include <uci.h>
+
+#include <rpcd/plugin.h>
+
+/* limit of log size buffer */
+#define RPC_LUCI2_MAX_LOGSIZE          (128 * 1024)
+#define RPC_LUCI2_DEF_LOGSIZE       (16 * 1024)
+
+/* location of menu definitions */
+#define RPC_LUCI2_MENU_FILES        "/usr/share/luci2/menu.d/*.json" /* */
 
-#include "luci2.h"
-#include "plugin.h"
 
 static const struct rpc_daemon_ops *ops;
 
@@ -1988,16 +1998,16 @@ menu_access(struct blob_attr *sid, struct blob_attr *acls, struct blob_buf *e)
 
        blobmsg_for_each_attr(acl, acls, rem)
        {
-               if (!ops->access(blobmsg_data(sid), "luci-ui",
-                                blobmsg_data(acl), "read"))
+               if (!ops->session_access(blobmsg_data(sid), "luci-ui",
+                                        blobmsg_data(acl), "read"))
                {
                        rv = false;
                        break;
                }
 
                blobmsg_add_u8(e, blobmsg_data(acl),
-                              ops->access(blobmsg_data(sid), "luci-ui",
-                                          blobmsg_data(acl), "write"));
+                              ops->session_access(blobmsg_data(sid), "luci-ui",
+                                                  blobmsg_data(acl), "write"));
        }
 
        blobmsg_close_table(e, c);