Skip to content

Commit

Permalink
conf: kill PAT_MAX bytes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 6185368 commit 41e9f73
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lxc/conf.c
Expand Up @@ -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,
Expand Down

0 comments on commit 41e9f73

Please sign in to comment.