Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2008 17:39:41 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, buckaroo@gmx.de
Subject:   Re: devfs ignores pass0 entry at boot time
Message-ID:  <200803101639.m2AGdfRu033305@lurza.secnetix.de>
In-Reply-To: <200803101543.43742.buckaroo@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Mark Nowiasz wrote:
 > Hah - I've found the bug!
 > 
 > devfs.rules has to end with an empty line,

No.  It has to end with a newline, because it is a
text file.

In UNIX, a valid text file is a concatenation of zero
or more lines, where each line *must* end with a newline,
including the last line.  If it doesn't, then it's not
a valid text file, leading to undefined behaviour.

For example, wc(1) doesn't count the last line if it's
not properly terminated.  Also, a shell loop (like
"while read line; do") will skip such illegal lines.
On the other hand, some tools accept such lines, and
some even silently add a newline if one is missing
(e.g. "sed <invalid >valid" will add the missing newline).

You should always make valid text files, so you can be
sure that there won't be any problems.

If you use a standard UNIX text editor such as ed or vi
to create and edit text files, they will automatically
make sure that every line is properly terminated, so
there won't be any problem.

 > An entry like
 > 
 > add path 'pass*' mode 660 group wheel user mark<EOF>
 > 
 > will be ignored, whereas
 > 
 > add path 'pass*' mode 660 group wheel user mark\n
 > <EOF>
 > 
 > will be honoured.
 > 
 > Well, this bug should be easy to fix

There is no bug.  I would expect the above behaviour.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Clear perl code is better than unclear awk code; but NOTHING
comes close to unclear perl code"  (taken from comp.lang.awk FAQ)



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