From 2f2ff087670150446f63e23a0f0758e6f3bc0e04 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 15 Jul 2005 13:11:02 +0000 Subject: [PATCH] STABLE14-windows-aklog-tweaks-20050715 * type correction * formatting * other cleanup (cherry picked from commit 1acd90549f183f185ac119096ba8c3fa1dcb3596) --- src/WINNT/aklog/aklog.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/WINNT/aklog/aklog.c b/src/WINNT/aklog/aklog.c index 5bb3b0264..d2eb3255c 100644 --- a/src/WINNT/aklog/aklog.c +++ b/src/WINNT/aklog/aklog.c @@ -183,7 +183,7 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell, { static char lastcell[MAXCELLCHARS+1] = { 0 }; static char confname[512] = { 0 }; - long viceId; /* AFS uid of user */ + afs_int32 viceId; /* AFS uid of user */ #ifdef ALLOW_REGISTER afs_int32 id; #endif /* ALLOW_REGISTER */ @@ -196,36 +196,14 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell, if (dflag) printf("About to resolve name %s to id\n", username); -#ifdef COMMENT - /* - * Talk about DUMB! It turns out that there is a bug in - * pr_Initialize -- even if you give a different cell name - * to it, it still uses a connection to a previous AFS server - * if one exists. The way to fix this is to change the - * _filename_ argument to pr_Initialize - that forces it to - * re-initialize the connection. We do this by adding and - * removing a "/" on the end of the configuration directory name. - */ - - if (lastcell[0] != '\0' && (strcmp(lastcell, aserver->cell) != 0)) { - int i = strlen(confname); - if (confname[i - 1] == '/') { - confname[i - 1] = '\0'; - } else { - confname[i] = '/'; - confname[i + 1] = '\0'; - } - } -#endif - strcpy(lastcell, aserver->cell); - if (!pr_Initialize (0, confname, aserver->cell)) { - char sname[PR_MAXNAMELEN]; - strncpy(sname, username, PR_MAXNAMELEN); - sname[PR_MAXNAMELEN-1] = '\0'; + if (!pr_Initialize (0, confname, aserver->cell)) { + char sname[PR_MAXNAMELEN]; + strncpy(sname, username, PR_MAXNAMELEN); + sname[PR_MAXNAMELEN-1] = '\0'; *status = pr_SNameToId (sname, &viceId); - } + } if (dflag) { -- 2.39.5