summaryrefslogtreecommitdiffstats
path: root/src/windows/leashdll/timesync.c
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2011-09-28 20:54:41 +0000
committerSam Hartman <hartmans@mit.edu>2011-09-28 20:54:41 +0000
commit3fb382036d67d67236b4205505c9bdbf9c1535bd (patch)
tree67dc8b0a325671cfa589788d0ddd327187272bdb /src/windows/leashdll/timesync.c
parent6bd64d22420172cbc6bcc4da485451baa9a72aed (diff)
downloadkrb5-3fb382036d67d67236b4205505c9bdbf9c1535bd.tar.gz
krb5-3fb382036d67d67236b4205505c9bdbf9c1535bd.tar.xz
krb5-3fb382036d67d67236b4205505c9bdbf9c1535bd.zip
miscellaneous leash32.dll corrections
do not build leash32.dll with MessageBox() calls. Doing so produces a library that on error must display a dialog box to the end user. If this library is called from a service (via gssapi32.dll) the service will block forever while awaiting the dialog box to clear. LeashKRB5GetTickets() treats krbv5Context as an in/out variable. If the caller does not provide a krb5_context, one will be allocated. It is up to the caller to ensure that the context is eventually freed. A context can be returned even if the function returns an error. Make sure that 'ctx' and 'cache' are properly initialized so that it is possible to tell the difference. Do not free the context if it was locally allocated. In acquire_tkt_no_princ() do not set the KRB5CCNAME environment variable if 'ccname' is an empty string. Combination of 2 patches by Jeffrey Altman From: Alexey Melnikov <alexey.melnikov@isode.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25248 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/leashdll/timesync.c')
-rw-r--r--src/windows/leashdll/timesync.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/windows/leashdll/timesync.c b/src/windows/leashdll/timesync.c
index 1c0bbbed2b..32ab5e6282 100644
--- a/src/windows/leashdll/timesync.c
+++ b/src/windows/leashdll/timesync.c
@@ -159,7 +159,6 @@ not_an_API_LeashGetTimeServerName(
LONG Leash_timesync(int MessageP)
{
char tmpstr[2048];
- char tmpstr1[2048];
char hostname[128];
int Port;
int rc;
@@ -197,6 +196,7 @@ LONG Leash_timesync(int MessageP)
rc = ProcessTimeSync(hostname, Port, tmpstr);
+#ifdef USE_MESSAGE_BOX
if(MessageP != 0)
{
if (rc && !*tmpstr)
@@ -204,6 +204,8 @@ LONG Leash_timesync(int MessageP)
strcpy(tmpstr, "Unable to syncronize time!\n\n");
if (*hostname)
{
+ char tmpstr1[2048];
+
memset(tmpstr1, '\0', sizeof(tmpstr1));
sprintf(tmpstr1, "Unreachable server: %s\n", hostname);
strcat(tmpstr, tmpstr1);
@@ -213,6 +215,7 @@ LONG Leash_timesync(int MessageP)
MessageBox(NULL, tmpstr, "Time Server",
MB_ICONERROR | MB_OK);
}
+#endif /* USE_MESSAGE_BOX */
WSACleanup();
return(rc);
}