[CRIU] [PATCH 8/8] tty: Don't fail on unprivileged tty params restore

Cyrill Gorcunov gorcunov at openvz.org
Mon Oct 5 12:54:37 PDT 2015


Restore of tty params requires CAP_SYS_ADMIN but
if criu is running in unprivileged mode we will
fail here. So simply print out an error but continue
execution, these parameters are actually not critical.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tty.c b/tty.c
index 63a6ba24eb73..0bfc108665ab 100644
--- a/tty.c
+++ b/tty.c
@@ -715,7 +715,7 @@ static int do_restore_tty_parms(void *arg, int fd, pid_t pid)
 
 err:
 	pr_perror("Can't set tty params on %d", p->tty_id);
-	return -1;
+	return (errno == EPERM) ? 0 : -1;
 }
 
 static int restore_tty_params(int fd, struct tty_info *info)
-- 
2.4.3



More information about the CRIU mailing list