If the prserver returns an empty response to ubik_PR_NameToID
or ubik_PR_IDToName, but doesn't otherwise give an error,
force a PRINTERNAL error return so that the client knows that the
the return parameter was not updated. Existing callers seem to
expect this, as pr_SNameToId is often called without initializing
the variable which receives the result and checking only for the
error code.
PRINTERNAL is a new error code.
Change-Id: I3e598a22deb39792a0f208ac09b3c1991d6f1e58
Reviewed-on: http://gerrit.openafs.org/7836
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
ec PRDBADDR, "bad database address"
ec PRTOOMANY, "too many elements in group"
ec PRNOMEM, "malloc failed to alloc enough memory"
+ ec PRINTERNAL, "Protection library internal error"
end
if (lids.idlist_val) {
*id = *lids.idlist_val;
xdr_free((xdrproc_t) xdr_idlist, &lids);
+ } else if (code == 0) {
+ code = PRINTERNAL;
}
if (lnames.namelist_val)
free(lnames.namelist_val);
if (lnames.namelist_val)
strncpy(name, lnames.namelist_val[0], PR_MAXNAMELEN);
+ else if (code == 0)
+ code = PRINTERNAL;
if (lids.idlist_val)
free(lids.idlist_val);