From: Jeffrey Altman Date: Thu, 25 Mar 2010 04:40:29 +0000 (-0400) Subject: Windows: aklog must reset viceId to 0 before pr_CreateUser call X-Git-Tag: openafs-devel-1_5_73_1~16 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fda5f9a37364b09ef0965d5512989f44aed880d7;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/WINNT/aklog/aklog.c b/src/WINNT/aklog/aklog.c index 04907af91..ee6600032 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 */