]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: kill PAT_MAX bytes
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 8 Feb 2021 09:22:00 +0000 (10:22 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 8 Feb 2021 09:22:41 +0000 (10:22 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 10a95d491bd0bf882d0951993940efdd5106e590..0f2f68bc7b7a2ada7c4cc083256e739fe56fc4ed 100644 (file)
@@ -2169,19 +2169,18 @@ skipabs:
 }
 
 static int mount_entry_on_relative_rootfs(struct mntent *mntent,
-                                         const struct lxc_rootfs *rootfs,
+                                         struct lxc_rootfs *rootfs,
                                          const char *lxc_name,
                                          const char *lxc_path)
 {
        int ret;
-       char path[PATH_MAX];
 
        /* relative to root mount point */
-       ret = snprintf(path, sizeof(path), "%s/%s", rootfs->mount, mntent->mnt_dir);
-       if (ret < 0 || (size_t)ret >= sizeof(path))
+       ret = snprintf(rootfs->buf, sizeof(rootfs->buf), "%s/%s", rootfs->mount, mntent->mnt_dir);
+       if (ret < 0 || (size_t)ret >= sizeof(rootfs->buf))
                return -1;
 
-       return mount_entry_on_generic(mntent, path, rootfs, lxc_name, lxc_path);
+       return mount_entry_on_generic(mntent, rootfs->buf, rootfs, lxc_name, lxc_path);
 }
 
 static int mount_file_entries(struct lxc_rootfs *rootfs, FILE *file,