]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: replace strextend_with_separator() -> strextendf_with_separator()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 20 Jun 2021 10:40:55 +0000 (19:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 21 Jun 2021 12:14:20 +0000 (21:14 +0900)
Fixes a bug introduced by cfea7618f28562c053a1ee194108feaa502081ff.

Before this commit:
mode=1777,size=10%,nr_inodes=400k,uid=496107520,gid=496107520,context=,sys.id:sys.role:systemd.nspawn.container.fs:s0,
After this commit:
mode=1777,size=10%,nr_inodes=400k,uid=496107520,gid=496107520,context=sys.id:sys.role:systemd.nspawn.container.fs:s0

Fixes #19976.

src/nspawn/nspawn-mount.c

index c28e42993524f04f58895120cb2d7e9abb57fafc..60f956da0f612a8b88d80b8716e981f42fb313fe 100644 (file)
@@ -398,7 +398,7 @@ int tmpfs_patch_options(
 
 #if HAVE_SELINUX
         if (selinux_apifs_context)
-                if (!strextend_with_separator(&buf, ",", "context=\"", selinux_apifs_context, "\""))
+                if (strextendf_with_separator(&buf, ",", "context=\"%s\"", selinux_apifs_context) < 0)
                         return -ENOMEM;
 #endif