There's a workaround in the code from a bug from back in 2004, it ends
and re-enters config mode anytime an `exit` is done from a level below
the top-level config node (e.g., from a `router isis` node). We need to
re-enter config mode with or without a lock according to how we actually
entered it to begin with.
fixes #13920
Signed-off-by: Christian Hopps <chopps@labn.net>
const char *mgmt_req_pending_cmd;
bool mgmt_locked_candidate_ds;
bool mgmt_locked_running_ds;
+ /* Need to track when we file-lock in vtysh to re-lock on end/conf t
+ * workaround
+ */
+ bool vtysh_file_locked;
};
static inline void vty_push_context(struct vty *vty, int node, uint64_t id)
/* resync in case one of the daemons is somewhere else */
vtysh_execute("end");
/* NOTE: a rather expensive thing to do, can we avoid it? */
- vtysh_execute("configure terminal file-lock");
+
+ if (vty->vtysh_file_locked)
+ vtysh_execute("configure terminal file-lock");
+ else
+ vtysh_execute("configure terminal");
}
+
return CMD_SUCCESS;
}
vty->node = CONFIG_NODE;
vtysh_execute_no_pager("enable");
- vtysh_execute_no_pager("configure terminal file-lock");
+ vtysh_execute_no_pager("conf term file-lock");
+ vty->vtysh_file_locked = true;
if (!dry_run)
vtysh_execute_no_pager("XFRR_start_configuration");
vtysh_execute_no_pager("XFRR_end_configuration");
vtysh_execute_no_pager("end");
+ vty->vtysh_file_locked = false;
vtysh_execute_no_pager("disable");
vty_close(vty);