From nobody  Fri Dec  4 14:27:23 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id OAA29548;
          Fri, 4 Dec 1998 14:27:23 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199812042227.OAA29548@hub.freebsd.org>
Date: Fri, 4 Dec 1998 14:27:23 -0800 (PST)
From: jason@engr.uky.edu
To: freebsd-gnats-submit@freebsd.org
Subject: yp_mkdb does not accept standard automountd-formated source file.
X-Send-Pr-Version: www-1.0

>Number:         8966
>Category:       bin
>Synopsis:       yp_mkdb does not accept standard automountd-formated source file.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec  4 14:30:00 PST 1998
>Closed-Date:    Sun Aug 22 08:38:47 PDT 1999
>Last-Modified:  Sun Aug 22 08:40:01 PDT 1999
>Originator:     Jason Swank
>Release:        2.2.7
>Organization:
University of Kentucky
>Environment:
FreeBSD blackbird.ecc.engr.uky.edu 2.2.7-RELEASE FreeBSD 2.2.7-RELEASE 
#0: Wed Jul 22 08:48:29 GMT 1998     
root@builder.cdrom.com:/usr/src/sys/compile/GENERIC  i386

>Description:
In addition to an amd-style map, I need to also serve an
automountd-style map for some HP-UX and Solaris hosts.  However,
I could not get yp_mkdb to create the automountd NIS map correctly--
it returned the error:

  yp_mkdb: bad character at start of line: jason

The input file for the map were valid, i.e. there were no odd
characters at the beginning of any lines.

Specifically,  I have two text files as sources for the two maps:
"auto.amd" for amd and "auto.home" for automountd.  The "auto.home"
format is exactly that found with NIS servers under Linux, HP-UX,
Solaris, Sun-OS, IRIX as well as page 329 of O'Reilly's "Managing NFS
and NIS".

  # cat auto.amd
  jason host!=blackbird;rfs:=/users1;rhost:=spitfire;type:=nfs;sublink
  :=jason;opts:=rw \
          host==blackbird;type:=link;fs:=/users1;sublink=jason

  # cat auto.home
  jason -rw,rsize=1024,wsize=1024 blackbird:/users1/jason


After spending several hours trying (seemingly) everything else, I
reversed the options of the data field to read: 
"rsize=1024,wsize=1024,-rw" and now all is well.

Basically, this is more of a very non-standard, non-documented,
poorly-errored annoyance than a serious bug. (According to the 
yp_mkdb manpage,any ASCII data can be used as key or data for
db style databases).


>How-To-Repeat:
Include a "-" as the beginning of the data entry for any NIS database.
>Fix:
(possible): Add "BUGS subsection to the yp_mkdb man page which reads:

  BUGS
      
       yp_mkdb seems to have a problem coping with some non-alphanumeric 
characters as the first character of the data element in the inputfile. 

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wpaul 
State-Changed-When: Sun Aug 22 08:38:47 PDT 1999 
State-Changed-Why:  

yp_mkdb has been modified to make the + and - sanity checks conditional 
on the use of a -f flag, and this is now only used for the passwd, group 
and master.passwd maps, which are the only ones for which + and - have 
special meaning. 

Fix has been made to -stable and -current. 

-Bill 
>Unformatted:
