Windows: cm_GetCell_Gen rework cell prefix matching
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 14 May 2015 22:29:45 +0000 (18:29 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 25 Sep 2015 03:28:27 +0000 (23:28 -0400)
commit4be60fbc0ea3ef880340c4648475f8dcb8aa2614
treefe085da035103580b920ed1a5624691d0e8a5bff
parent3d89c768680142a71051922d9f787e2946052ecd
Windows: cm_GetCell_Gen rework cell prefix matching

The cm_GetCell_Gen() function permits cells to be searched for by
prefix.  The idea is to permit "cs.cmu.edu" to be abbreviated "cs"
when at CMU.  There are two problems with the current behavior:

1. the existing match rules will accept "cs.c" and "cs.cmu.ed" as
   valid prefix matches.  By not restricting the prefix matching
   to full components the Freelance symlink list can become
   cluttered.

2. the existing match rules will accept the first cell that
   matches even if there are more than one cells that would match.
   this can result in unpredictable behavior since the ordering
   of the cells is not guaranteed.

Instead, fail requests for cell prefixes that are not full component
matches or that would be ambiguous.

Reviewed-on: http://gerrit.openafs.org/11886
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e314167f11f289248704426fe65fea13a734a937)

Change-Id: I8de6f9972f15cf12ae13b157e26ee181eeec220b
Reviewed-on: http://gerrit.openafs.org/12042
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsd/cm_cell.c