Bug 51628 - [nis] ypmatch doesn't match keys in legacy NIS servers
Summary: [nis] ypmatch doesn't match keys in legacy NIS servers
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.8-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-30 16:30 UTC by Keith White
Modified: 2017-12-31 22:36 UTC (History)
0 users

See Also:


Attachments
file.diff (911 bytes, patch)
2003-04-30 16:30 UTC, Keith White
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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