curl-library
Kerberos on Windows
Date: Wed, 3 Dec 2003 18:18:26 +0100
I'm not sure this is a futile attempt, but looking briefly at KRB5 sources
it should build okay on Windows (it includes Makefles for MSVC) and
AFAICS it is backward compatible with KRB4. I've never used Kerberos,
so this would be a new experience. Are there many hosts still using it?
Until then I have a small patch (non-Cygwin doesn't have syslog):
--- CVS-latest\lib\krb4.c Tue Dec 02 14:27:29 2003
+++ lib\krb4.c Tue Dec 02 15:07:45 2003
@@ -46,8 +46,11 @@
#include "security.h"
#include "base64.h"
#include <stdlib.h>
+#if !defined(WIN32) && !defined(__CYGWIN__)
#include <netdb.h>
#include <syslog.h>
+#define USE_SYSLOG
+#endif
#include <string.h>
#include <krb.h>
#include <des.h>
@@ -129,7 +132,12 @@
(struct sockaddr_in *)REMOTE_ADDR,
(struct sockaddr_in *)LOCAL_ADDR, &m);
if(e){
+#ifdef USE_SYSLOG
syslog(LOG_ERR, "krb4_decode: %s", krb_get_err_text(e));
+#else
+ struct SessionHandle *data = conn->data;
+ infof(data, "krb4_decode: %s\n", krb_get_err_text(e)););
+#endif
return -1;
}
memmove(buf, m.app_data, m.app_length);
-----------------------
verboseconnect() says "Connected to .." while in fact connection is
in progress. Not sure a okay/error message should be after connect() or
not. IMHO it should look something like:
"Connecting to %s (%s) port %d ..."
fflush() ?
connect()
"okay\n" | "failed: %s\n."
--- CVS-latest\lib\url.c Tue Dec 02 14:27:29 2003
+++ lib\url.c Wed Dec 03 17:45:53 2003
@@ -1822,10 +1822,10 @@
snprintf(hbuf, sizeof(hbuf), "?");
}
if (ai->ai_canonname) {
- infof(data, "Connected to %s (%s) port %d\n", ai->ai_canonname, hbuf,
+ infof(data, "Connecting to %s (%s) port %d\n", ai->ai_canonname, hbuf,
conn->port);
} else {
- infof(data, "Connected to %s port %d\n", hbuf, conn->port);
+ infof(data, "Connecting to %s port %d\n", hbuf, conn->port);
}
}
#else
@@ -1833,7 +1833,7 @@
Curl_addrinfo *hostaddr=dns?dns->addr:NULL;
struct in_addr in;
(void) memcpy(&in.s_addr, &conn->serv_addr.sin_addr, sizeof (in.s_addr));
- infof(data, "Connected to %s (%s) port %d\n",
+ infof(data, "Connecting to %s (%s) port %d\n",
hostaddr?hostaddr->h_name:"",
#if defined(HAVE_INET_NTOA_R)
inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf)),
------
--gv
-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
Received on 2003-12-03