call chase_symlinks without the /sysroot prefix (#6411)
authorHarald Hoyer <harald@hoyer.xyz>
Thu, 20 Jul 2017 17:13:09 +0000 (19:13 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Jul 2017 17:13:09 +0000 (13:13 -0400)
In case fstab-generator is called in the initrd, chase_symlinks()
returns with a canonical path "/sysroot/sysroot/<mountpoint>", if the
"/sysroot" prefix is present in the path.

This patch skips the "/sysroot" prefix for the chase_symlinks() call,
because "/sysroot" is already the root directory and chase_symlinks()
prepends the root directory in the canonical path returned.

src/fstab-generator/fstab-generator.c

index ea5ceb3..8fc4c8d 100644 (file)
@@ -526,7 +526,7 @@ static int parse_fstab(bool initrd) {
                         continue;
                 }
 
-                where = initrd ? strappend("/sysroot/", me->mnt_dir) : strdup(me->mnt_dir);
+                where = strdup(me->mnt_dir);
                 if (!where)
                         return log_oom();