misc/153156: When watch is invoked incorrectly it trashes the tty
Jeff Wheelhouse
freebsd at wheelhouse.org
Tue Dec 14 20:20:08 UTC 2010
>Number: 153156
>Category: misc
>Synopsis: When watch is invoked incorrectly it trashes the tty
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Dec 14 20:20:07 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Jeff Wheelhouse
>Release: 8.2-PRERELEASE
>Organization:
GridFury, LLC
>Environment:
FreeBSD h2 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Sat Dec 11 12:09:32 UTC 2010 root at h2:/usr/obj/usr/src/sys/CUSTOM i386
>Description:
If watch is invoked incorrectly (without privileges) it exits with the appropriate diagnostic, but leaves the tty in an unusable state. It prints "> " for every keypress.
This can be resolved by doing "stty sane </dev/pts/###" from another session.
>How-To-Repeat:
h2:jdw$ tty
/dev/pts/0
h2:jdw$ watch
watch: snp module not available: Operation not permitted
watch: fatal: cannot open snoop device
h2:jdw$ > > > > > > > >
>Fix:
Workaround:
h2:jdw$ tty
/dev/pts/8
h2:jdw$ stty sane </dev/pts/0
h2:jdw$
The proper fix is probably to call a cleanup function when exiting along this error path.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list