Windows: output pt error messages as strings

Build and link in ptserver/pterror.c so that aklog
can output pt error messages as strings.

LICENSE MIT

Change-Id: I93d966e0e62bb693612c6310781aadbfa6c09988
Reviewed-on: http://gerrit.openafs.org/1658
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2010-03-24 22:07:29 -04:00 committed by Jeffrey Altman
parent af41515608
commit 114ed05d8d
2 changed files with 13 additions and 5 deletions

View File

@ -22,6 +22,11 @@ AKLOGOBJS = \
$(OUT)\aklog.obj \
$(OUT)\linked_list.obj
PTERROBJS=$(OUT)\pterror.obj
$(PTERROBJS): $(AFSROOT)\src\ptserver\pterror.c
$(C2OBJ) /Fo$@ $**
ASETKEY = $(DESTDIR)\root.server\usr\afs\bin\asetkey.exe
ASETKEYOBJS = \
@ -58,7 +63,7 @@ $(ASETKEYOBJS): $$(@B).c
############################################################################
$(AKLOG) : $(AKLOGOBJS) $(EXELIBS) $(OUT)\aklog.res
$(AKLOG) : $(AKLOGOBJS) $(PTERROBJS) $(EXELIBS) $(OUT)\aklog.res
$(EXECONLINK) $(EXELIBS) $(OTHERLIBS) $(LINKOPTS)
$(_VC_MANIFEST_EMBED_EXE)
$(EXEPREP)

View File

@ -301,7 +301,7 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell,
if (dflag)
{
if (*status)
printf("Error %d\n", *status);
printf("pr_SNameToId Error %s\n", afs_error_message(*status));
else
printf("Id %d\n", viceId);
}
@ -357,7 +357,7 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell,
*/
if ((*status = pr_Initialize(1L, confname, aserver->cell))) {
printf("Error %d\n", *status);
printf("pr_Initialize Error %s\n", afs_error_message(*status));
return;
}
@ -371,8 +371,8 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell,
if (*status) {
printf("%s: unable to create remote PTS "
"user %s in cell %s (status: %d).\n", progname,
username, cell_to_use, *status);
"user %s in cell %s (status: %s).\n", progname,
username, cell_to_use, afs_error_message(*status));
} else {
printf("created cross-cell entry for %s (Id %d) at %s\n",
username, viceId, cell_to_use);
@ -1552,6 +1552,9 @@ int main(int argc, char *argv[])
}
}
if (!noprdb)
initialize_PT_error_table();
if (usev5) {
validate_krb5_availability();
if (krb5_init_context(&context))