]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/install: fix crash when reenable is called without --root
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Apr 2022 18:42:32 +0000 (20:42 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 15 Apr 2022 16:26:07 +0000 (18:26 +0200)
src/shared/install.c

index 58bccdcaa80d69a04f4dd63af3c4b853829cf3fc..f7257c5ceb87163d7a2d6c803548c7ea68e8cdd6 100644 (file)
@@ -2825,7 +2825,7 @@ static int normalize_linked_files(
                         return r;
 
                 const char *p = NULL;
-                if (i && i->path)
+                if (i && i->path && i->root)
                         /* Use startswith here, because we know that paths are normalized, and
                          * path_startswith() would give us a relative path, but we need an absolute path
                          * relative to i->root.