From 41e9f73c2779bc03c2b12da5227382c5f6800b4c Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 8 Feb 2021 10:22:00 +0100 Subject: [PATCH] conf: kill PAT_MAX bytes Signed-off-by: Christian Brauner --- src/lxc/conf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 9147ee4fc0..a8465d1f27 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2169,19 +2169,18 @@ static int mount_entry_on_absolute_rootfs(struct mntent *mntent, } 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,