|
@@ -1309,6 +1309,17 @@ out:
|
|
|
return retval;
|
|
|
}
|
|
|
|
|
|
+static void set_special_pids(struct pid *pid)
|
|
|
+{
|
|
|
+ struct task_struct *curr = current->group_leader;
|
|
|
+
|
|
|
+ if (task_session(curr) != pid)
|
|
|
+ change_pid(curr, PIDTYPE_SID, pid);
|
|
|
+
|
|
|
+ if (task_pgrp(curr) != pid)
|
|
|
+ change_pid(curr, PIDTYPE_PGID, pid);
|
|
|
+}
|
|
|
+
|
|
|
SYSCALL_DEFINE0(setsid)
|
|
|
{
|
|
|
struct task_struct *group_leader = current->group_leader;
|
|
@@ -1328,7 +1339,7 @@ SYSCALL_DEFINE0(setsid)
|
|
|
goto out;
|
|
|
|
|
|
group_leader->signal->leader = 1;
|
|
|
- __set_special_pids(sid);
|
|
|
+ set_special_pids(sid);
|
|
|
|
|
|
proc_clear_tty(group_leader);
|
|
|
|