Bug 250 - /etc/netstart executes undesired hostname.xxx files
Summary: /etc/netstart executes undesired hostname.xxx files
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: GNATS administrator
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1995-03-17 21:50 UTC by smp
Modified: 1995-03-17 21:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description smp 1995-03-17 21:50:00 UTC
	/etc/netstart may attempt to execute unwanted hostname.xxx
	files.  This has variuos effects, from none to wedging the
	system.  The specific problem is that the line:

	ifn=`expr $i : '/etc/hostname\.\(.*\)'`

	will return the end of ANY filename starting with "/etc/hostname."
	Eg., if one copies hostname.ed0 to hostname.ed0.HIDE netstart will
	evaluate it anyway.  I was bitten by an emacs backup file (ie,
	hostname.ed0~)

Fix: 

edit /etc/netstart:

< 	ifn=`expr $i : '/etc/hostname\.\(.*\)'`
---
> 	ifn=`expr $i : '/etc/hostname\.\(.*[0-9]$\)'`

The above fix was not ideal, instead use a variable as a list of
interfaces and a set of variables, one per interface to contain
the data.  Totally eliminate the /etc/hostname.* files.
How-To-Repeat: 
	use emacs to edit hostname.ed0, changing some vital field.
	Reboot the kernel.  netstart will attempt to run ifconfig on both
	hostname.ed0 AND hostname.ed0~
Comment 1 Rodney W. Grimes freebsd_committer freebsd_triage 1995-04-11 02:32:09 UTC
State Changed
From-To: open->closed

Fixed by netstart 1.27, rc 1.62 and sysconfig 1.10