From 6e2e78c494f58bfe87c4b0ece48f1744b6413fd0 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Thu, 15 Apr 2021 15:12:25 +0300 Subject: [PATCH] parse tablespace_map correctly --- src/dir.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dir.c b/src/dir.c index e1d9e580..f150039e 100644 --- a/src/dir.c +++ b/src/dir.c @@ -1153,7 +1153,7 @@ read_tablespace_map(parray *links, const char *backup_dir) path[MAXPGPATH]; pgFile *file; - if (sscanf(buf, "%1023s %1023s", link_name, path) != 2) + if (sscanf(buf, "%s %n", link_name, path) != 2) elog(ERROR, "invalid format found in \"%s\"", map_path); file = pgut_new(pgFile); @@ -1279,13 +1279,19 @@ check_tablespace_mapping(pgBackup *backup, bool incremental, bool force, bool pg TablespaceListCell *cell; bool remapped = false; + elog(INFO, "Linked path: \"%s\"", linked_path); + for (cell = tablespace_dirs.head; cell; cell = cell->next) + { + elog(INFO, "Remap dir: \"%s\"", cell->old_dir); + if (strcmp(link->linked, cell->old_dir) == 0) { linked_path = cell->new_dir; remapped = true; break; } + } if (!is_absolute_path(linked_path)) elog(ERROR, "Tablespace directory path must be an absolute path: %s\n",