Subject: bin/11847: init(8) mishandles EOF at altshell prompt
To: None <>
From: Ben Harris <>
List: netbsd-bugs
Date: 12/30/2000 04:38:13
>Number:         11847
>Category:       bin
>Synopsis:       init(8) mishandles EOF at altshell prompt
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 30 04:38:01 PST 2000
>Originator:     Ben Harris
>Release:        2000-12-29
NetBSD/arm26 1.5P

Pressing ctrl-D at the init "Enter pathname of shell or RETURN for
sh:" prompt causes it to emit the odd message "can't exec rm2 for single
user".  It looks like single_user() calls fgets to read the name of the
shell, but doesn't check for a NULL return.  When faced with EOF, fgets
returns NULL and doesn't modify the input string, so init gets whatever
was left on the stack.

Boot single user.
Press ctrl-D at the prompt.