[OpenAFS-devel] ptuser interfaces: inconsistent downcasing

Garrett Wollman wollman@csail.mit.edu
Wed, 25 Jul 2012 11:48:09 -0400


<<On Tue, 24 Jul 2012 22:06:35 -0400, I wrote:

> Some interfaces in the client-side protection library, like
> pr_CreateUser, pr_CreateGroup, and pr_SNameToId, unconditionally
> downcase their arguments, which prevents them from being constified.
> Other interfaces, like pr_AddToGroup and pr_RemoveUserFromGroup, do
> not do so.  Can anyone explain the reason for this inconsistency?  It
> would make more sense to me if these interfaces either all did
> case-folding, or all did not.

Another strange inconsistency: these routines are very unclear about
whether they are dealing with strings or not.  In places they are
careful to use interfaces like strncpy() that work on buffers, but
in other places they call string-only interfaces like stolower() that
will cheerfully walk off the end of the buffer.  Is PR_MAXNAMELEN
supposed to account for a trailing null or not?  (The RPC side of
things appears to believe the latter, although I haven't looked
closely enough to be certain.)

-GAWollman