Bug 51628

Summary: [nis] ypmatch doesn't match keys in legacy NIS servers
Product: Base System Reporter: Keith White <Keith.White>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.8-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Keith White 2003-04-30 16:30:06 UTC
ypmatch does not match keys in NIS databases that include the NULL
in the key field.

Databases that started out on SunOS 4.X, say, include NULL in both
the key and data fields.  This makes it impossible to use ypmatch
to check for the existence of keys since the terminating NULL
is removed prior to calling yp_match().

Try this against a SunOS 4.x NIS server: 
  $ ypmatch @ aliases
  ypmatch: can't match key @ in map mail.aliases. reason: No such key in map

Try it at the same time on a Solaris host:
  $ ypmatch @ aliases
  @

(FWIW the '@' key is used to signify that the NIS aliases database is
up-to-date.  When it doesn't exist the aliases database is in the
process of being updated.)

Fix: The following patch will do another yp_match() call including the
terminating NULL in the key if the first call failed.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:03 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped