Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!harpo!seismo!hao!hplabs!sri-unix!mike@brl-vgr From: mike%brl-vgr@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Sign bit smeared in TIOCLGET Message-ID: <14646@sri-arpa.UUCP> Date: Thu, 15-Dec-83 19:56:11 EST Article-I.D.: sri-arpa.14646 Posted: Thu Dec 15 19:56:11 1983 Date-Received: Tue, 20-Dec-83 01:24:26 EST Lines: 32 From: Michael John Muuss Index: sys/sys/tty.c 4.2BSD Description: If the high bit of the "local flags" is set, TIOCLGET smears that bit across the high halfword of the int by the >>16. Credit for finding this goes to Doug Gwyn, . Repeat-By: Set the bit with TIOCLSET, and read it back with TIOCLGET. Fix: Mask the data. See diff -c listing below. *** tty.c~ Thu Dec 15 19:47:12 1983 --- tty.c Thu Dec 15 19:48:14 1983 *************** break; case TIOCLGET: ! *(int *)data = tp->t_flags >> 16; break; /* should allow SPGRP and GPGRP only if tty open for reading */ -------------- break; case TIOCLGET: ! *(int *)data = (tp->t_flags >> 16) & 0xFFFF; break; /* should allow SPGRP and GPGRP only if tty open for reading */