summaryrefslogtreecommitdiff
path: root/uci.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-01-12 17:33:46 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-01-12 17:42:05 +0000
commitb0254d1203c9611ecdcf2ad9d6c9a43b80b44724 (patch)
treebc013cb0d6094045778dcf1015b429661c201b7d /uci.c
parent7cac6af5edf4e376ab16f0773f86274765c898ad (diff)
downloadrpcd-b0254d1203c9611ecdcf2ad9d6c9a43b80b44724.tar.gz
debug
Diffstat (limited to 'uci.c')
-rw-r--r--uci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/uci.c b/uci.c
index 3bbb9c8..08489e3 100644
--- a/uci.c
+++ b/uci.c
@@ -1392,6 +1392,10 @@ rpc_uci_apply(struct ubus_context *ctx, struct ubus_object *obj,
return ret;
}
+ /* copy SID early because rpc_uci_apply_config() will clobber buf */
+ if (rollback)
+ strncpy(apply_sid, sid, RPC_SID_LEN);
+
for (i = 0; i < gl.gl_pathc; i++) {
char *config = basename(gl.gl_pathv[i]);
struct stat s;
@@ -1410,7 +1414,6 @@ rpc_uci_apply(struct ubus_context *ctx, struct ubus_object *obj,
globfree(&gl);
if (rollback) {
- strncpy(apply_sid, sid, RPC_SID_LEN);
apply_timer.cb = rpc_uci_apply_timeout;
uloop_timeout_set(&apply_timer, timeout * 1000);
apply_ctx = ctx;
@@ -1439,6 +1442,8 @@ rpc_uci_confirm(struct ubus_context *ctx, struct ubus_object *obj,
if (!apply_sid[0])
return UBUS_STATUS_NO_DATA;
+ printf("CMP=%s/%s\n", apply_sid, sid);
+
if (strcmp(apply_sid, sid))
return UBUS_STATUS_PERMISSION_DENIED;