1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-20 14:03:39 +03:00

execute: improve log message about TTY ownership reset failures

(cherry picked from commit 026a8b022e1f0883b09d99c360a738506814407a)
(cherry picked from commit 5af41ce0bce0915865f8e830bfe7cc50ac2b7e53)
(cherry picked from commit fb159f16c4b8d6c5ffd2ec7eb539ecbd0969420e)
This commit is contained in:
Lennart Poettering 2023-12-06 16:38:53 +01:00 committed by Luca Boccassi
parent cdc8d56e75
commit 3786a2ed42

View File

@ -6471,7 +6471,7 @@ void exec_context_revert_tty(ExecContext *c) {
if (!path)
return;
fd = open(path, O_PATH|O_CLOEXEC);
fd = open(path, O_PATH|O_CLOEXEC); /* Pin the inode */
if (fd < 0)
return (void) log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, errno,
"Failed to open TTY inode of '%s' to adjust ownership/access mode, ignoring: %m",
@ -6490,7 +6490,7 @@ void exec_context_revert_tty(ExecContext *c) {
r = fchmod_and_chown(fd, TTY_MODE, 0, TTY_GID);
if (r < 0)
log_warning_errno(r, "Failed to reset TTY ownership/access mode of %s, ignoring: %m", path);
log_warning_errno(r, "Failed to reset TTY ownership/access mode of %s to " UID_FMT ":" GID_FMT ", ignoring: %m", path, (uid_t) 0, (gid_t) TTY_GID);
}
int exec_context_get_clean_directories(