The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3577
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Closes: #3576. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From a2c26befc91ab2a93b97b6135f24c14734a3cc08 Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Thu, 5 Nov 2020 20:25:29 +0100 Subject: [PATCH] attach: silence stdio permission adjust warnings Closes: #3576. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- src/lxc/attach.c | 2 +- src/lxc/utils.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lxc/attach.c b/src/lxc/attach.c index acbffa238d..cfddf9b36a 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -883,7 +883,7 @@ static int attach_child_main(struct attach_clone_payload *payload) /* Make sure that the processes STDIO is correctly owned by the user that we are switching to */ ret = fix_stdio_permissions(new_uid); if (ret) - WARN("Failed to adjust stdio permissions"); + INFO("Failed to adjust stdio permissions"); if (!lxc_switch_uid_gid(new_uid, new_gid)) goto on_error; diff --git a/src/lxc/utils.c b/src/lxc/utils.c index baf80b7f5c..fdf437ef35 100644 --- a/src/lxc/utils.c +++ b/src/lxc/utils.c @@ -1885,11 +1885,11 @@ int fix_stdio_permissions(uid_t uid) devnull_fd = open_devnull(); if (devnull_fd < 0) - return log_warn_errno(-1, errno, "Failed to open \"/dev/null\""); + return log_trace_errno(-1, errno, "Failed to open \"/dev/null\""); ret = fstat(devnull_fd, &st_null); if (ret) - return log_warn_errno(-errno, errno, "Failed to stat \"/dev/null\""); + return log_trace_errno(-errno, errno, "Failed to stat \"/dev/null\""); for (int i = 0; i < ARRAY_SIZE(std_fds); i++) { ret = fstat(std_fds[i], &st); @@ -1904,14 +1904,15 @@ int fix_stdio_permissions(uid_t uid) ret = fchown(std_fds[i], uid, st.st_gid); if (ret) { - SYSWARN("Failed to chown standard I/O file descriptor %d to uid %d and gid %d", - std_fds[i], uid, st.st_gid); + TRACE("Failed to chown standard I/O file descriptor %d to uid %d and gid %d", + std_fds[i], uid, st.st_gid); fret = -1; + continue; } ret = fchmod(std_fds[i], 0700); if (ret) { - SYSWARN("Failed to chmod standard I/O file descriptor %d", std_fds[i]); + TRACE("Failed to chmod standard I/O file descriptor %d", std_fds[i]); fret = -1; } }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel