Commit f7934aa3 authored by Pavel Tikhomirov's avatar Pavel Tikhomirov Committed by Andrei Vagin

files: make convert_path_from_another_mp always return relative path

If dmi->ns_mountpoint is "/" then in dst we will return "/..." -
absolute path but we want here path relative to dmi mount. Adding "./"
before the path guaranties that it will be always relative.

https://jira.sw.ru/browse/PSBM-72351Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 248a04e0
......@@ -1347,7 +1347,7 @@ static void convert_path_from_another_mp(char *src, char *dst, int dlen,
* Absolute path to the mount point + difference between source
* and destination roots + path relative to the mountpoint.
*/
snprintf(dst, dlen, "%s/%s/%s",
snprintf(dst, dlen, "./%s/%s/%s",
dmi->ns_mountpoint + 1,
smi->root + strlen(dmi->root),
src + off);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment