Fix snapshot path resolution and aliased paths by storing sub_dir in fssnapshot_struct

This commit is contained in:
Andrea Mazzoleni 2026-08-25 23:09:39 +02:00
parent 7f1e53a6c8
commit 5ec235e445
4 changed files with 68 additions and 26 deletions

View file

@ -532,6 +532,9 @@ int fssnapshot_mount(const char* dir, struct fssnapshot_struct* fss)
return -1;
}
size_t root_len = strlen(fss->root_dir);
pathcpy(fss->sub_dir, sizeof(fss->sub_dir), dir + root_len);
pathcpy(fss->snapshot_dir, sizeof(fss->snapshot_dir), fss->root_dir);
pathcat(fss->snapshot_dir, sizeof(fss->snapshot_dir), SNAPSHOT_CONTAINER "/");