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

Submitted by Cyrill Gorcunov on Feb. 15, 2018, 8:30 p.m.

Details

Message ID 20180215203030.7513-5-gorcunov@virtuozzo.com
State New
Series "criu: Add support for ctty inheritance"
Headers show

Commit Message

Cyrill Gorcunov Feb. 15, 2018, 8:30 p.m.
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@virtuozzo.com>
---
 criu/tty.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

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;