[Devel] [PATCH 4/7] tty: Don't check for group inheritance

Cyrill Gorcunov gorcunov at gmail.com
Thu Feb 15 23:30:27 MSK 2018


The group may vary so we only need to check
if sid is reachable, othrewise it might trigger
false positive.

Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
 criu/tty.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/criu/tty.c b/criu/tty.c
index 1eb239b81..4cc99690f 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -2311,20 +2311,19 @@ static int tty_verify_ctty(void)
 
 		list_for_each_entry(p, &all_ttys, list) {
 			if (!is_pty(p->driver)	||
-			    p->sid != d->sid	||
-			    p->pgrp != d->sid)
+			    p->sid != d->sid)
 				continue;
 			n = p;
 			break;
 		}
 
 		if (!n) {
-			pr_err("ctty inheritance detected sid/pgrp %d, "
-			       "no PTY peer with sid/pgrp needed\n",
+			pr_err("ctty inheritance detected sid %d, "
+			       "no PTY peer with sid needed\n",
 			       d->sid);
 			return -ENOENT;
 		} else if (n->pid_real != d->pid_real) {
-			pr_err("ctty inheritance detected sid/pgrp %d "
+			pr_err("ctty inheritance detected sid %d "
 			       "(ctty pid_real %d pty pid_real %d)\n",
 			       d->sid, d->pid_real, n->pid_real);
 			return -ENOENT;
-- 
2.14.3



More information about the Devel mailing list