Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 2010 20:16:03 GMT
From:      Jeff Wheelhouse <freebsd@wheelhouse.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/153156: When watch is invoked incorrectly it trashes the tty
Message-ID:  <201012142016.oBEKG33V066397@red.freebsd.org>
Resent-Message-ID: <201012142020.oBEKK7S9062340@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012142016.oBEKG33V066397>