diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2024-01-25 19:59:22 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2024-01-27 19:02:52 +0100 |
| commit | bfd6d8ee19e94f9cc945e3847f1fd275bbc01b44 (patch) | |
| tree | 4124cc71210fa6892189d56cc154819e735a4e31 /lib/libfrr.c | |
| parent | 567f5702c0ec53700388383030e55fee49459389 (diff) | |
lib, mgmtd: fix commit history location
Both of these belong in `/var/lib`, not `/var/run`.
Rather hilariously, the history read in
`mgmt_history_read_cmt_record_index` was always failing, because it was
doing a `file_exists(MGMTD_COMMIT_FILE_PATH)` check. Which is the wrong
macro - it's `.../commit-%s.json`, including the unprocessed `%s`, which
would never exist.
I guess noone ever tried if this actually works. Cool.
On the plus side, this means I don't have to implement legacy
compatibility for this, since it never worked to begin with.
(SQLite3 DB location is also changed in this commit since it also uses
`DAEMON_DB_DIR`.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index 131453c4de..fe2c8fa82c 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -47,9 +47,6 @@ DEFINE_KOOH(frr_fini, (), ()); const char frr_sysconfdir[] = SYSCONFDIR; char frr_runstatedir[256] = FRR_RUNSTATE_PATH; char frr_libstatedir[256] = FRR_LIBSTATE_PATH; -#ifdef HAVE_SQLITE3 -const char frr_dbdir[] = DAEMON_DB_DIR; -#endif const char frr_moduledir[] = MODULE_PATH; const char frr_scriptdir[] = SCRIPT_PATH; @@ -347,7 +344,7 @@ void frr_preinit(struct frr_daemon_info *daemon, int argc, char **argv) snprintf(frr_zclientpath, sizeof(frr_zclientpath), ZAPI_SOCK_NAME); #ifdef HAVE_SQLITE3 snprintf(dbfile_default, sizeof(dbfile_default), "%s/%s.db", - frr_dbdir, di->name); + frr_libstatedir, di->name); #endif strlcpy(frr_protoname, di->logname, sizeof(frr_protoname)); @@ -728,7 +725,7 @@ struct event_loop *frr_init(void) frr_runstatedir, di->name, p_instance); #ifdef HAVE_SQLITE3 snprintf(dbfile_default, sizeof(dbfile_default), "%s/%s%s%s.db", - frr_dbdir, p_pathspace, di->name, p_instance); + frr_libstatedir, p_pathspace, di->name, p_instance); #endif zprivs_preinit(di->privs); |
