From 1dd71c90e807bc730415eb40b51c3bea19d298a9 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 18 Feb 2021 16:40:52 +0100 Subject: [PATCH] conf: use saner mode for console Signed-off-by: Christian Brauner --- src/lxc/conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index f2a3b62af..8d63c5164 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1713,7 +1713,7 @@ static int lxc_setup_dev_console(struct lxc_rootfs *rootfs, if (ret < 0 && errno != EEXIST) return log_error_errno(-errno, errno, "Failed to create console"); - ret = fchmod(console->pty, S_IXUSR | S_IXGRP); + ret = fchmod(console->pty, 0620); if (ret < 0) return log_error_errno(-errno, errno, "Failed to set mode \"0%o\" to \"%s\"", S_IXUSR | S_IXGRP, console->name); @@ -1775,7 +1775,7 @@ static int lxc_setup_ttydir_console(struct lxc_rootfs *rootfs, if (ret < 0 && errno != EEXIST) return log_error_errno(-errno, errno, "Failed to create console"); - ret = fchmod(console->pty, S_IXUSR | S_IXGRP); + ret = fchmod(console->pty, 0620); if (ret < 0) return log_error_errno(-errno, errno, "Failed to set mode \"0%o\" to \"%s\"", S_IXUSR | S_IXGRP, console->name); -- 2.47.2