From fda5f9a37364b09ef0965d5512989f44aed880d7 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 25 Mar 2010 00:40:29 -0400 Subject: [PATCH] Windows: aklog must reset viceId to 0 before pr_CreateUser call If the viceId is not reset to 0, the ptserver believes the client is attempting to request the anonymous id value and fails the registration request with permission denied. LICENSE MIT Change-Id: I82cc6105ad9d08b2f460b0c08cf7de500cea8537 Reviewed-on: http://gerrit.openafs.org/1659 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/aklog/aklog.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/WINNT/aklog/aklog.c b/src/WINNT/aklog/aklog.c index 04907af91c..ee66000321 100644 --- a/src/WINNT/aklog/aklog.c +++ b/src/WINNT/aklog/aklog.c @@ -364,18 +364,16 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell, /* copy the name because pr_CreateUser lowercases the realm */ strncpy(username_copy, username, BUFSIZ); - *status = pr_CreateUser(username, &viceId); - - /* and restore the name to the original state */ - strncpy(username, username_copy, BUFSIZ); + viceId = 0; + *status = pr_CreateUser(username_copy, &viceId); if (*status) { printf("%s: unable to create remote PTS " "user %s in cell %s (status: %s).\n", progname, - username, cell_to_use, afs_error_message(*status)); + username_copy, 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); + username_copy, viceId, cell_to_use); #ifdef AFS_ID_TO_NAME snprintf (username, BUFSIZ, "%s (AFS ID %d)", username_copy, (int) viceId); #endif /* AFS_ID_TO_NAME */