Subject: bin/24583: /etc/security doesn't parse /etc/exports correctly
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jukka-netbsd@2004.salmi.ch>
List: netbsd-bugs
Date: 02/27/2004 19:10:34
>Number:         24583
>Category:       bin
>Synopsis:       /etc/security doesn't parse /etc/exports correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 27 18:11:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jukka Salmi
>Release:        NetBSD 1.6.2
>Organization:
>Environment:
System: NetBSD bart.stasoft.ch 1.6.2 NetBSD 1.6.2 (BART) #0: Tue Feb 24 18:30:15 CET 2004 root@bart.stasoft.ch:/usr/src/sys/arch/i386/compile/BART i386
Architecture: i386
Machine: i386
>Description:
With NetBSD -current and stable, checking of /etc/exports in /etc/security
(check_nfs) is not done correctly. Several things are wrongly assumed:

- only one directory can be specified per entry
- logical lines are physical lines
- the host set starts with a minus sign (-)

But the following is true:

- several directories can be may be specified per entry
- lines can be continued using \ because src/usr.sbin/mountd/mountd.c,
  line 1043, read /etc/exports using fparseln(3).
- the host set can be specified as -network=... -mask=...

>How-To-Repeat:
An /etc/exports entry as follows:

/a/directory /another/dir \
  -ro -maproot=nobody:nobody -network=1.2.3.4 -mask=255.255.255.0

is syntactically correct and doen't export the directories globally, but
results in the following text being output during /etc/security execution:

Checking for globally exported file systems.
File system -ro globally exported, read-write.

>Fix:
Patch follows...
>Release-Note:
>Audit-Trail:
>Unformatted: