diff -r f28bb31024b4 -r cf499fd51df7 librazor/root.c --- a/librazor/root.c Wed Aug 20 18:57:59 2014 +0100 +++ b/librazor/root.c Sat Aug 23 16:07:09 2014 +0100 @@ -102,7 +102,7 @@ } file = razor_concat(razor_root_path, "/", system_repo_filename, NULL); - path = razor_concat(root, file, NULL); + path = razor_path_add_root(file, root); retval = !stat(path, &buf); if (retval) { razor_set_error(error, NULL, @@ -133,7 +133,7 @@ razor_root_open(const char *root, struct razor_error **error) { struct razor_root *image; - char *lock_path; + char *s, *lock_path; int r; assert (root != NULL); @@ -152,8 +152,9 @@ return NULL; } - lock_path = razor_concat(root, razor_root_path, "/", - system_lock_filename, NULL); + s = razor_concat(razor_root_path, "/", system_lock_filename, NULL); + lock_path = razor_path_add_root(s, root); + free(s); r = razor_set_aquire_lock(image->system, lock_path, 1); @@ -167,8 +168,9 @@ return NULL; } - image->path = razor_concat(root, razor_root_path, "/", - system_repo_filename, NULL); + s = razor_concat(razor_root_path, "/", system_repo_filename, NULL); + image->path = razor_path_add_root(s, root); + free(s); if (razor_set_bind_sections(image->system, image->path, RAZOR_SET_PRIVATE, error)) { @@ -184,7 +186,7 @@ RAZOR_EXPORT struct razor_set * razor_root_open_read_only(const char *root, struct razor_error **error) { - char *path; + char *s, *path; struct razor_set *set; assert (root != NULL); @@ -196,8 +198,10 @@ return NULL; } - path = razor_concat(root, razor_root_path, "/", system_lock_filename, - NULL); + s = razor_concat(razor_root_path, "/", system_lock_filename, NULL); + path = razor_path_add_root(s, root); + free(s); + if (razor_set_aquire_lock(set, path, 0) < 0) { razor_set_error(error, NULL, "Failed to aquire non-exclusive system lock"); @@ -207,8 +211,10 @@ } free(path); - path = razor_concat(root, razor_root_path, "/", system_repo_filename, - NULL); + + s = razor_concat(razor_root_path, "/", system_repo_filename, NULL); + path = razor_path_add_root(s, root); + free(s); if (razor_set_bind_sections(set, path, 0, error)) { razor_set_unref(set);