Subject: kern/27802: on disk full, last-edited file opened instead of binary
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <krinsky+netbsd@bantha.org>
List: netbsd-bugs
Date: 11/02/2004 15:44:22
>Number:         27802
>Category:       kern
>Synopsis:       on disk full, last-edited file opened instead of binary
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 02 20:45:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     David Krinsky
>Release:        NetBSD 2.0_RC4
>Organization:
>Environment:
	
	
System: NetBSD bantha.org 2.0_RC4 NetBSD 2.0_RC4 (GENERIC) #0: Sun Oct 17 19:11:36 UTC 2004 autobuild@tgm.netbsd.org:/autobuild/netbsd-2-0/i386/OBJ/autobuild/netbsd-2-0/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	Unbeknownst to me at the time, /var had just filled up due to
	a user's mail loop.

	I edited /etc/inetd.conf and kill -HUP'ed inetd in a root 
	shell.  In a concurrent, non-root shell, I attempted to invoke
	telnet to check my work.  Instead of exec'ing telnet, my shell (zsh)
	attempted to execute /etc/inetd.conf:

[10:00] krinsky-q7 bantha:[~] 832> telnet localhost
imap: not found
imaps: not found
: not found

: not found

: not found
: not found
/usr/bin/telnet: 94: Syntax error: "(" unexpected
zsh: exit 2     telnet localhost
You have new mail.
[10:05] krinsky-q7 bantha:[~] 833> telnet localhost
imap: not found
imaps: not found
: not found

: not found

: not found
: not found
/usr/bin/telnet: 94: Syntax error: "(" unexpected
zsh: exit 2     telnet localhost
[10:05] krinsky-q7 bantha:[~] 834> which telnet
/usr/bin/telnet
[10:05] krinsky-q7 bantha:[~] 835> less /usr/bin/telnet
[10:05] krinsky-q7 bantha:[~] 836> cd /usr/bin
[10:05] krinsky-q7 bantha:[/usr/bin] 837> ls -l telnet
-r-xr-xr-x  1 root  wheel  121502 Oct 17 13:56 telnet*
[10:05] krinsky-q7 bantha:[/usr/bin] 838> date
Tue Nov  2 10:05:57 EST 2004
[10:05] krinsky-q7 bantha:[/usr/bin] 839> ls -l | less
[10:06] krinsky-q7 bantha:[/usr/bin] 840> less telnet
"telnet" may be a binary file.  See it anyway? 

	Note that the first invocation (835) of "less /usr/bin/telnet"
	did not print a "'telnet' may be a binary file" warning, and
	indeed, it displayed /etc/inetd.conf.  The second invocation
	(840) displayed what appears to have been the correct
	/usr/bin/telnet binary.

	Note also that / (containing /etc), /usr, and /var are all 
	separate NetBSD partitions, albeit on the same drive, and only
	/var was at the time full.

	/etc/inetd.conf is not and was not executable, and
	/usr/bin/telnet has not been modified since the system was
	installed.

	Because this is a multiuser system in active use (as a shell
	account, mail, and web server), I cannot be certain of what
	other disk activity was in progress, but /etc/inetd.conf was the
	last file I had overtly written to immediately before this.  

	I believe that /var had filled up before these events took place,
	but I didn't discover this until just afterward.
>How-To-Repeat:
	Unknown, but see above.
>Fix:
	Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: