tp += sizeof(uuid);
len += sizeof(uuid);
-#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
if (ktcMutex == NULL)
return KTC_TOKEN_MUTEX_FAIL;
strcpy(rpcErr, "RPC failure in AFS gateway");
else
DceErrorInqText(status, rpcErr);
- if (status == RPC_S_SERVER_UNAVAILABLE ||
+
+ ReleaseMutex(ktcMutex);
+ CloseHandle(ktcMutex);
+
+ if (status == RPC_S_SERVER_UNAVAILABLE ||
status == EPT_S_NOT_REGISTERED) {
- ReleaseMutex(ktcMutex);
- CloseHandle(ktcMutex);
return KTC_NOCMRPC;
} else {
- ReleaseMutex(ktcMutex);
- CloseHandle(ktcMutex);
return KTC_RPC;
}
}
-#endif /* AFS_WIN95_ENV */
/* set up for pioctl */
iob.in = tbuffer;
code = pioctl(0, VIOCSETTOK, &iob, 0);
-#ifndef AFS_WIN95_ENV
ReleaseMutex(ktcMutex);
CloseHandle(ktcMutex);
-#endif /* AFS_WIN95_ENV */
if (code) {
if (code == -1) {
iob.out = tbuffer;
iob.out_size = sizeof(tbuffer);
-#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
if (ktcMutex == NULL)
return KTC_TOKEN_MUTEX_FAIL;
return KTC_TOKEN_MUTEX_FAIL;
}
}
-#endif /* AFS_WIN95_ENV */
code = pioctl(0, VIOCNEWGETTOK, &iob, 0);
if (code) {
-#ifndef AFS_WIN95_ENV
ReleaseMutex(ktcMutex);
CloseHandle(ktcMutex);
-#endif /* AFS_WIN95_ENV */
+
if (code == -1) {
if (errno == ESRCH)
return KTC_NOCELL;
} else
return KTC_PIOCTLFAIL;
}
-#ifndef AFS_WIN95_ENV
- /* get rid of RPC for win95 build */
+
/* RPC to receive session key */
status = receive_key(uuid, token->sessionKey.data);
CloseHandle(ktcMutex);
if (status != RPC_S_OK) {
- if (status == 1)
- strcpy(rpcErr, "RPC failure in AFS gateway");
- else
- DceErrorInqText(status, rpcErr);
- if (status == RPC_S_SERVER_UNAVAILABLE
- || status == EPT_S_NOT_REGISTERED)
- return KTC_NOCMRPC;
- else
- return KTC_RPC;
+ if (status == 1)
+ strcpy(rpcErr, "RPC failure in AFS gateway");
+ else
+ DceErrorInqText(status, rpcErr);
+
+ if (status == RPC_S_SERVER_UNAVAILABLE ||
+ status == EPT_S_NOT_REGISTERED)
+ return KTC_NOCMRPC;
+ else
+ return KTC_RPC;
}
-#endif /* AFS_WIN95_ENV */
cp = tbuffer;
iob.out = tbuffer;
iob.out_size = sizeof(tbuffer);
-#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
if (ktcMutex == NULL)
return KTC_TOKEN_MUTEX_FAIL;
return KTC_TOKEN_MUTEX_FAIL;
}
}
-#endif /* AFS_WIN95_ENV */
#if 0
code = pioctl(0, VIOC_GETTOK2, &iob, 0);
errno = EINVAL;
#endif
-#ifndef AFS_WIN95_ENV
ReleaseMutex(ktcMutex);
CloseHandle(ktcMutex);
-#endif /* AFS_WIN95_ENV */
/* If we can't use the new pioctl, the fall back to the old one. We then
* need to convert the rxkad token we get back into the new format
int code;
HANDLE ktcMutex = NULL;
-#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
if (ktcMutex == NULL)
return KTC_TOKEN_MUTEX_FAIL;
return KTC_TOKEN_MUTEX_FAIL;
}
}
-#endif /* AFS_WIN95_ENV */
tp = tbuffer;
code = pioctl(0, VIOCGETTOK, &iob, 0);
-#ifndef AFS_WIN95_ENV
ReleaseMutex(ktcMutex);
CloseHandle(ktcMutex);
-#endif /* AFS_WIN95_ENV */
if (code) {
if (code == -1) {
if (strcmp(server->name, "afs")) {
return ForgetOneLocalToken(server);
}
-#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
if (ktcMutex == NULL)
return KTC_TOKEN_MUTEX_FAIL;
return KTC_TOKEN_MUTEX_FAIL;
}
}
-#endif /* AFS_WIN95_ENV */
tp = tbuffer;
iob.out_size = sizeof(tbuffer);
code = pioctl(0, VIOCDELTOK, &iob, 0);
-#ifndef AFS_WIN95_ENV
ReleaseMutex(ktcMutex);
CloseHandle(ktcMutex);
-#endif /* AFS_WIN95_ENV */
+
if (code) {
if (code == -1) {
if (errno == ESRCH)
(void)ForgetLocalTokens();
-#ifndef AFS_WIN95_ENV
ktcMutex = CreateMutex(NULL, TRUE, AFSGlobalKTCMutexName);
if (ktcMutex == NULL)
return KTC_TOKEN_MUTEX_FAIL;
return KTC_TOKEN_MUTEX_FAIL;
}
}
-#endif /* AFS_WIN95_ENV */
/* do pioctl */
iob.in = tbuffer;
iob.out_size = sizeof(tbuffer);
code = pioctl(0, VIOCDELALLTOK, &iob, 0);
-#ifndef AFS_WIN95_ENV
ReleaseMutex(ktcMutex);
CloseHandle(ktcMutex);
-#endif /* AFS_WIN95_ENV */
+
if (code) {
if (code == -1) {
if (errno == ENODEV)