kernel/tty: Use GID_TTY for non root users by default.
authorzrj <rimvydas.jasinskas@gmail.com>
Fri, 19 Apr 2019 10:32:55 +0000 (13:32 +0300)
committerzrj <zrj@dragonflybsd.org>
Mon, 22 Apr 2019 19:11:57 +0000 (22:11 +0300)
Previous behaviour defaulting to GID_WHEEL was confusing OpenSSH tests.

sys/kern/tty_pty.c

index ba51065..975a9c8 100644 (file)
@@ -665,7 +665,7 @@ ptcopen(struct dev_open_args *ap)
        pti->pt_ucntl = 0;
 
        pti->devs->si_uid = ap->a_cred->cr_uid;
        pti->pt_ucntl = 0;
 
        pti->devs->si_uid = ap->a_cred->cr_uid;
-       pti->devs->si_gid = 0;
+       pti->devs->si_gid = ap->a_cred->cr_uid ? GID_TTY : 0;
        pti->devs->si_perms = 0600;
        pti->devc->si_uid = ap->a_cred->cr_uid;
        pti->devc->si_gid = 0;
        pti->devs->si_perms = 0600;
        pti->devc->si_uid = ap->a_cred->cr_uid;
        pti->devc->si_gid = 0;