[320] in Kerberos_V5_Development
Extension to krb5_unparse_name
daemon@ATHENA.MIT.EDU (Theodore Ts'o)
Thu Oct 11 14:27:05 1990
Date: Thu, 11 Oct 90 12:09:58 -0400
From: Theodore Ts'o <tytso@ATHENA.MIT.EDU>
To: krbdev@ATHENA.MIT.EDU
Reply-To: tytso@ATHENA.MIT.EDU
I propose that we add the following interface to the Kerberos V library:
krb5_unparse_name_ext(/* IN */
krb5_principal *principal
/* INOUT */
char **name,
int *size)
This function would behave exactly like krb5_unparse_name if {\em size}
is NULL. If {\em size} is non-null, then it is assumed to be a pointer
to an integer variable indicating the allocated size of {\em name}. If
the unparsed principal requires more allocated space, then
krb5_unparse_name_ext will realloc {\em name} and update {\em size} to
be the new size.
The rational for this function is that it would speed up the database
dump routine quite a bit, since it we wouldn't have to be continually
malloc'ing and free'ing space for the unparsed principal name. Given
that we want to keep the database locked for as little a time as
possible, this would be a Good Thing.
- Ted
P.S. I've already rewritten parse.c and unparse.c to handle arbitrary
principal names, using backquoting to protect components which contain
'/', '@', and '\0'. unparse.c, of course, already has the interface
already. I'm planning on dropping them into the library, if there are
no objections.