1 --- misc/neon-0.29.5/src/config.h 2011-02-03 10:32:38.000000000 +0100
2 +++ misc/build/neon-0.29.5/src/config.h 2011-02-03 10:26:19.000000000 +0100
6 +/* Define to specific EGD socket path */
9 +/* Define if EGD should be supported */
10 +/* #undef ENABLE_EGD */
12 +/* Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise */
13 +/* #undef GSS_C_NT_HOSTBASED_SERVICE */
15 +/* Define to 1 if you have the <arpa/inet.h> header file. */
17 +#define HAVE_ARPA_INET_H 1
20 +/* Define to 1 if you have the `bind_textdomain_codeset' function. */
21 +/* #undef HAVE_BIND_TEXTDOMAIN_CODESET 1 */
23 +/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
26 +#define HAVE_DECL_H_ERRNO 1
29 +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
32 +#define HAVE_DECL_STPCPY 1
35 +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
38 +#define HAVE_DECL_STRERROR_R 1
41 +/* Define to 1 if you have the <dlfcn.h> header file. */
43 +#define HAVE_DLFCN_H 1
46 +/* Define to 1 if you have the <errno.h> header file. */
47 +#define HAVE_ERRNO_H 1
49 +/* Define if you have expat */
50 +/* #undef HAVE_EXPAT */
52 +/* Define to 1 if you have the `fstat64' function. */
55 +/* Define to 1 if you have the `gai_strerror' function. */
56 +#define HAVE_GAI_STRERROR 1
58 +/* Define if GnuTLS support is enabled */
59 +/* #undef HAVE_GNUTLS */
61 +/* Define to 1 if you have the `gnutls_session_get_data2' function. */
62 +/* #undef HAVE_GNUTLS_SESSION_GET_DATA2 */
64 +/* Define if GSSAPI support is enabled */
65 +/* #undef HAVE_GSSAPI */
67 +/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
68 +/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
70 +/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
71 +/* #undef HAVE_GSSAPI_GSSAPI_H */
73 +/* Define to 1 if you have the <gssapi.h> header file. */
74 +/* #undef HAVE_GSSAPI_H */
76 +/* Define to 1 if you have the `gss_init_sec_context' function. */
77 +/* #undef HAVE_GSS_INIT_SEC_CONTEXT */
79 +/* Define to 1 if you have the `hstrerror' function. */
80 +/* #undef HAVE_HSTRERROR */
82 +/* Define to 1 if you have the `inet_ntop' function. */
84 +#define HAVE_INET_NTOP 1
87 +/* Define to 1 if you have the <inttypes.h> header file. */
89 +#define HAVE_INTTYPES_H 1
92 +/* Define to 1 if you have the `isatty' function. */
93 +#define HAVE_ISATTY 1
95 +/* Define to 1 if you have the <libintl.h> header file. */
96 +/* #undef HAVE_LIBINTL_H */
98 +/* Define if you have libxml */
99 +#define HAVE_LIBXML 1
101 +/* Define to 1 if you have the <libxml/parser.h> header file. */
102 +#define HAVE_LIBXML_PARSER_H 1
104 +/* Define to 1 if you have the <libxml/xmlversion.h> header file. */
105 +#define HAVE_LIBXML_XMLVERSION_H 1
107 +/* Define to 1 if you have the <limits.h> header file. */
108 +#define HAVE_LIMITS_H 1
110 +/* Define to 1 if you have the <locale.h> header file. */
111 +#define HAVE_LOCALE_H 1
113 +/* Define to 1 if you have the `lseek64' function. */
114 +#define HAVE_LSEEK64 1
116 +/* Define to 1 if you have the <memory.h> header file. */
117 +#define HAVE_MEMORY_H 1
119 +/* Define to 1 if you have the <netdb.h> header file. */
121 +#define HAVE_NETDB_H 1
124 +/* Define to 1 if you have the <netinet/in.h> header file. */
126 +#define HAVE_NETINET_IN_H 1
129 +/* Define to 1 if you have the <netinet/tcp.h> header file. */
131 +#define HAVE_NETINET_TCP_H 1
134 +/* Define if OpenSSL support is enabled */
135 +#define HAVE_OPENSSL 1
137 +/* Define to 1 if you have the <openssl/opensslv.h> header file. */
138 +#define HAVE_OPENSSL_OPENSSLV_H 1
140 +/* Define to 1 if you have the <openssl/ssl.h> header file. */
141 +#define HAVE_OPENSSL_SSL_H 1
143 +/* Define to 1 if you have the `pipe' function. */
146 +/* Define to 1 if you have the `poll' function. */
149 +/* Define to 1 if you have the `pthread_mutex_init' function. */
150 +/* #undef HAVE_PTHREAD_MUTEX_INIT */
152 +/* Define to 1 if you have the `pthread_mutex_lock' function. */
153 +/* #undef HAVE_PTHREAD_MUTEX_LOCK */
155 +/* Define to 1 if you have the `setlocale' function. */
156 +#define HAVE_SETLOCALE 1
158 +/* Define to 1 if you have the `setsockopt' function. */
159 +#if defined (LINUX) || defined (WIN32)
160 +#define HAVE_SETSOCKOPT 1
163 +/* Define to 1 if you have the `setvbuf' function. */
164 +#define HAVE_SETVBUF 1
166 +/* Define to 1 if you have the `shutdown' function. */
168 +#define HAVE_SHUTDOWN 1
171 +/* Define to 1 if you have the `signal' function. */
172 +#define HAVE_SIGNAL 1
174 +/* Define to 1 if you have the <signal.h> header file. */
175 +#define HAVE_SIGNAL_H 1
177 +/* Define to 1 if you have the `snprintf' function. */
179 +#define HAVE_SNPRINTF 1
183 +#define snprintf _snprintf
186 +/* Define to 1 if you have the <socks.h> header file. */
187 +/* #undef HAVE_SOCKS_H */
189 +/* Define to 1 if you have the <stdarg.h> header file. */
190 +#define HAVE_STDARG_H 1
192 +/* Define to 1 if you have the <stdint.h> header file. */
193 +#define HAVE_STDINT_H 1
195 +/* Define to 1 if you have the <stdlib.h> header file. */
196 +#define HAVE_STDLIB_H 1
198 +/* Define to 1 if you have the `stpcpy' function. */
200 +#define HAVE_STPCPY 1
203 +/* Define to 1 if you have the `strcasecmp' function. */
205 +#define HAVE_STRCASECMP 1
209 +#define strcasecmp strcmpi
212 +/* Define to 1 if you have the `strerror_r' function. */
214 +#define HAVE_STRERROR_R 1
217 +/* Define to 1 if you have the <strings.h> header file. */
219 +#define HAVE_STRINGS_H 1
222 +/* Define to 1 if you have the <string.h> header file. */
223 +#define HAVE_STRING_H 1
225 +/* Define to 1 if you have the `strtoll' function. */
226 +#define HAVE_STRTOLL 1
228 +/* Define to 1 if you have the `strtoq' function. */
229 +/* #undef HAVE_STRTOQ */
231 +/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
233 +#define HAVE_STRUCT_TM_TM_GMTOFF 1
236 +/* Define to 1 if `__tm_gmtoff' is member of `struct tm'. */
237 +/* #undef HAVE_STRUCT_TM___TM_GMTOFF */
239 +/* Define to 1 if you have the <sys/limits.h> header file. */
240 +/* #undef HAVE_SYS_LIMITS_H */
242 +/* Define to 1 if you have the <sys/poll.h> header file. */
244 +#define HAVE_SYS_POLL_H 1
247 +/* Define to 1 if you have the <sys/select.h> header file. */
249 +#define HAVE_SYS_SELECT_H 1
252 +/* Define to 1 if you have the <sys/socket.h> header file. */
254 +#define HAVE_SYS_SOCKET_H 1
257 +/* Define to 1 if you have the <sys/stat.h> header file. */
258 +#define HAVE_SYS_STAT_H 1
260 +/* Define to 1 if you have the <sys/time.h> header file. */
262 +#define HAVE_SYS_TIME_H 1
265 +/* Define to 1 if you have the <sys/types.h> header file. */
266 +#define HAVE_SYS_TYPES_H 1
268 +/* Define if the timezone global is available */
270 +#define HAVE_TIMEZONE 1
273 +/* Use trio printf replacement library */
274 +/* #undef HAVE_TRIO */
276 +/* Define to 1 if you have the <trio.h> header file. */
277 +/* #undef HAVE_TRIO_H */
279 +/* Define to 1 if you have the <unistd.h> header file. */
281 +#define HAVE_UNISTD_H 1
284 +/* Define to 1 if you have the `usleep' function. */
286 +#define HAVE_USLEEP 1
289 +/* Define to 1 if you have the `vsnprintf' function. */
290 +#if defined( UNX ) || (defined(_MSC_VER) && (_MSC_VER > 1400))
291 +#define HAVE_VSNPRINTF 1
295 +#if (defined(_MSC_VER) && (_MSC_VER < 1500)) || defined(__MINGW32__)
296 +#define vsnprintf _vsnprintf
300 +/* Define to be location of localedir */
301 +/* #undef LOCALEDIR */
303 +/* Defined when neon is built as a library */
304 +#define NEON_IS_LIBRARY 1
306 +/* Define to be the neon version string */
307 +#define NEON_VERSION "0.29.5"
309 +/* Define to enable debugging */
310 +/* #undef NE_DEBUGGING */
312 +/* Define to be printf format string for off64_t */
313 +#define NE_FMT_OFF64_T "lld"
315 +/* Define to be printf format string for off_t */
316 +#define NE_FMT_OFF_T "ld"
318 +/* Define to be printf format string for size_t */
319 +#define NE_FMT_SIZE_T "u"
321 +/* Define to be printf format string for ssize_t */
322 +#define NE_FMT_SSIZE_T "d"
324 +/* Define to be printf format string for time_t */
325 +#define NE_FMT_TIME_T "ld"
327 +/* Defined if DAV is supported */
328 +#define NE_HAVE_DAV 1
330 +/* Defined if I18N is supported */
331 +/* #undef NE_HAVE_I18N 1 */
333 +/* Defined if IPV6 is supported */
334 +#define NE_HAVE_IPV6 1
336 +/* Defined if LFS is supported */
337 +#define NE_HAVE_LFS 1
339 +/* Defined if SOCKS is supported */
340 +/* #undef NE_HAVE_SOCKS */
342 +/* Defined if SSL is supported */
345 +/* Defined if TS_SSL is supported */
346 +/* #undef NE_HAVE_TS_SSL */
348 +/* Defined if ZLIB is supported */
349 +#define NE_HAVE_ZLIB 1
351 +/* Define to be filename of an SSL CA root bundle */
352 +/* #undef NE_SSL_CA_BUNDLE */
354 +/* Define if poll() should be used */
356 +#define NE_USE_POLL 1
359 +/* Define to be neon library major version */
360 +#define NE_VERSION_MAJOR (0)
362 +/* Define to be neon library minor version */
363 +#define NE_VERSION_MINOR (29)
365 +/* Define to be neon library patch version */
366 +#define NE_VERSION_PATCH (5)
368 +/* Define to the address where bug reports for this package should be sent. */
369 +#define PACKAGE_BUGREPORT "neon@webdav.org"
371 +/* Define to the full name of this package. */
372 +#define PACKAGE_NAME "neon"
374 +/* Define to the full name and version of this package. */
375 +#define PACKAGE_STRING "neon 0.29.5"
377 +/* Define to the one symbol short name of this package. */
378 +#define PACKAGE_TARNAME "neon"
380 +/* Define to the version of this package. */
381 +#define PACKAGE_VERSION "0.29.5"
383 +/* The size of a `int', as computed by sizeof. */
384 +#define SIZEOF_INT 4
386 +/* The size of a `long', as computed by sizeof. */
387 +#define SIZEOF_LONG 4
389 +/* The size of a `long long', as computed by sizeof. */
390 +#define SIZEOF_LONG_LONG 8
392 +/* The size of a `off64_t', as computed by sizeof. */
393 +#define SIZEOF_OFF64_T 8
395 +/* The size of a `off_t', as computed by sizeof. */
396 +#define SIZEOF_OFF_T 4
398 +/* The size of a `size_t', as computed by sizeof. */
399 +#define SIZEOF_SIZE_T 4
401 +/* The size of a `ssize_t', as computed by sizeof. */
402 +#define SIZEOF_SSIZE_T 4
404 +/* The size of a `time_t', as computed by sizeof. */
405 +#define SIZEOF_TIME_T 4
407 +/* Define to 1 if you have the ANSI C header files. */
409 +#define STDC_HEADERS 1
412 +/* Define to 1 if strerror_r returns char *. */
414 +#define STRERROR_R_CHAR_P 1
417 +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
418 +#define TIME_WITH_SYS_TIME 1
420 +/* Define if getaddrinfo supports AI_ADDRCONFIG */
421 +/* #undef USE_GAI_ADDRCONFIG */
423 +/* Define if getaddrinfo() should be used */
424 +#define USE_GETADDRINFO 1
426 +/* Define to 1 if your processor stores words with the most significant byte
427 + first (like Motorola and SPARC, unlike Intel and VAX). */
428 +#if defined (SOLARIS) && defined (SPARC)
429 +#define WORDS_BIGENDIAN 1
432 +/* Always defined to enable GNU extensions */
433 +#define _GNU_SOURCE 1
435 +/* Define to empty if `const' does not conform to ANSI C. */
438 +/* Define if in_addr_t is not available */
439 +/* #undef in_addr_t */
441 +/* Define to `__inline__' or `__inline' if that's what the C compiler
442 + calls it, or to nothing if 'inline' is not supported under any name. */
444 +#if defined (SOLARIS) && defined (__SUNPRO_C)
449 +/* Define to `long' if <sys/types.h> does not define. */
452 +/* Define to `int' if <sys/types.h> does not define. */
455 +/* Define to `unsigned' if <sys/types.h> does not define. */
458 +/* MS IIS does not send Lock-Token response header after creation of a */
459 +/* new lock. This violates RFC, but... if we want to talk with this */
460 +/* beast we need a workaround */
461 +#define IIS_LOCK_BUG_WORKAROUND 1
463 +/* Enable leak-tracking versions of ne_*alloc when NEON_MEMLEAK is enabled */
465 +# include "memleak.h"
468 +#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy)
469 +char *stpcpy(char *, const char *);
476 +#define HAVE_MEMCPY 1
478 +#define strncasecmp strnicmp
479 +#define inline __inline
480 +#define WIN32_LEAN_AND_MEAN
493 --- misc/neon-0.29.5/src/makefile.mk 2011-02-03 10:32:38.000000000 +0100
494 +++ misc/build/neon-0.29.5/src/makefile.mk 2011-02-03 10:26:19.000000000 +0100
497 +PRJ=..$/..$/..$/..$/..
504 +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
507 +# --- Settings -----------------------------------------------------
509 +.INCLUDE : settings.mk
511 +# --- Files --------------------------------------------------------
513 +CDEFS+=-DHAVE_CONFIG_H
515 +.IF "$(SYSTEM_LIBXML)" == "YES"
516 +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
518 +LIBXMLINCDIR=external$/libxml
519 +CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXMLINCDIR)
522 +.IF "$(SYSTEM_OPENSSL)" == "YES"
523 +CFLAGS+= $(OPENSSL_CFLAGS)
526 +.IF "$(SYSTEM_ZLIB)" == "YES"
527 +CFLAGS+=-DSYSTEM_ZLIB
529 +ZLIBINCDIR=external$/zlib
530 +CFLAGS+=-I$(SOLARINCDIR)$/$(ZLIBINCDIR)
534 + $(SLO)$/ne_207.obj \
535 + $(SLO)$/ne_acl3744.obj \
536 + $(SLO)$/ne_alloc.obj \
537 + $(SLO)$/ne_auth.obj \
538 + $(SLO)$/ne_basic.obj \
539 + $(SLO)$/ne_compress.obj \
540 + $(SLO)$/ne_dates.obj \
541 + $(SLO)$/ne_i18n.obj \
542 + $(SLO)$/ne_locks.obj \
543 + $(SLO)$/ne_md5.obj \
544 + $(SLO)$/ne_props.obj \
545 + $(SLO)$/ne_redirect.obj \
546 + $(SLO)$/ne_request.obj \
547 + $(SLO)$/ne_session.obj \
548 + $(SLO)$/ne_socket.obj \
549 + $(SLO)$/ne_socks.obj \
550 + $(SLO)$/ne_string.obj \
551 + $(SLO)$/ne_uri.obj \
552 + $(SLO)$/ne_utils.obj \
553 + $(SLO)$/ne_xml.obj \
554 + $(SLO)$/ne_xmlreq.obj \
555 + $(SLO)$/ne_openssl.obj
558 +SLOFILES+=$(SLO)$/ne_sspi.obj
560 +SLOFILES+=$(SLO)$/ne_ntlm.obj
563 +# $(SLO)$/ne_gnutls.obj \
564 +# $(SLO)$/ne_stubssl.obj
566 +SHL1OBJS=$(SLOFILES)
567 +SHL1TARGET=$(TARGET)
568 +SHL1VERSIONMAP=exports.map
569 +SHL1IMPLIB=i$(TARGET)
571 +SHL1STDLIBS+= $(LIBXML2LIB) \
575 + SHL1STDLIBS+= $(WS2_32LIB)
576 + SHL1STDLIBS+= $(OPENSSLLIB)
578 + .IF "$(OS)"=="SOLARIS"
579 + SHL1STDLIBS+= -lnsl -lsocket -ldl
581 + .IF "$(SYSTEM_OPENSSL)"=="YES"
582 + SHL1STDLIBS+= $(OPENSSLLIB)
584 + SHL1STDLIBS+= $(OPENSSLLIBST)
588 +SHL1DEF=$(MISC)$/$(SHL1TARGET).def
590 +# --- Targets ------------------------------------------------------
591 +DEF1NAME=$(SHL1TARGET)
592 +.INCLUDE : target.mk
593 --- misc/neon-0.29.5/src/ne_auth.c 2010-10-14 17:00:53.000000000 +0200
594 +++ misc/build/neon-0.29.5/src/ne_auth.c 2011-02-03 10:31:22.000000000 +0100
596 static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt,
597 struct auth_challenge *chall, char *pwbuf)
599 - if (chall->handler->creds(chall->handler->userdata, sess->realm,
600 + if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm,
601 chall->handler->attempt++, sess->username, pwbuf) == 0) {
604 @@ -385,15 +385,19 @@
606 char *tmp, password[NE_ABUFSIZ];
608 +#if 0 /* Workaround - IIS sends challenge without realm. */
610 /* Verify challenge... must have a realm */
611 if (parms->realm == NULL) {
612 challenge_error(errmsg, _("missing realm in Basic challenge"));
619 - sess->realm = ne_strdup(parms->realm);
620 + if (parms->realm != NULL)
621 + sess->realm = ne_strdup(parms->realm);
623 if (get_credentials(sess, errmsg, attempt, parms, password)) {
624 /* Failed to get credentials */
625 @@ -610,10 +614,12 @@
629 -static int continue_sspi(auth_session *sess, int ntlm, const char *hdr)
630 +static int continue_sspi(auth_session *sess, int ntlm, const char *hdr,
631 + int attempt, struct auth_challenge *parms, ne_buffer **errmsg)
634 char *response = NULL;
635 + char password[NE_ABUFSIZ];
637 NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n");
644 - status = ne_sspi_authenticate(sess->sspi_context, hdr, &response);
646 + /* Authentification needs more than one http request.
647 + * As long as authentification in progress use the existing credentials.
648 + * Otherwise get new credentials.*/
650 + if (get_credentials(sess, errmsg, attempt, parms, password)) {
651 + /* Failed to get credentials */
655 + status = ne_sspi_authenticate(sess->sspi_context, hdr, &response, sess->username, password);
661 int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
663 - return continue_sspi(sess, ntlm, parms->opaque);
664 + return continue_sspi(sess, ntlm, parms->opaque, attempt, parms, errmsg);
667 static int verify_sspi(struct auth_request *req, auth_session *sess,
672 - return continue_sspi(sess, ntlm, ptr);
673 + return continue_sspi(sess, ntlm, ptr, 0, NULL, NULL);
677 --- misc/neon-0.29.5/src/ne_auth.h 2009-09-01 22:13:12.000000000 +0200
678 +++ misc/build/neon-0.29.5/src/ne_auth.h 2011-02-03 10:26:20.000000000 +0100
680 * Hint: if you just wish to attempt authentication just once (even if
681 * the user gets the username/password wrong), have the callback
682 * function use 'attempt' value as the function return value. */
683 -typedef int (*ne_auth_creds)(void *userdata, const char *realm, int attempt,
684 - char *username, char *password);
685 +typedef int (*ne_auth_creds)(void *userdata, const char * auth_protocol,
686 + const char *realm, int attempt, char *username, char *password);
688 /* Set callbacks to provide credentials for server and proxy
689 * authentication, using the default set of authentication protocols.
690 --- misc/neon-0.29.5/src/ne_defs.h 2010-01-11 23:57:34.000000000 +0100
691 +++ misc/build/neon-0.29.5/src/ne_defs.h 2011-02-03 10:26:20.000000000 +0100
695 /* define ssize_t for Win32 */
696 -#if defined(WIN32) && !defined(ssize_t)
697 +#if defined(WIN32) && !defined(ssize_t) && !defined(__MINGW32__)
701 --- misc/neon-0.29.5/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100
702 +++ misc/build/neon-0.29.5/src/ne_locks.c 2011-02-03 10:26:21.000000000 +0100
704 const char *token = ne_get_response_header(ctx->req, "Lock-Token");
705 /* at the root element; retrieve the Lock-Token header,
706 * and bail if it wasn't given. */
707 +#ifdef IIS_LOCK_BUG_WORKAROUND
708 + /* MS IIS violates RFC 2518/4918. It does not send a Lock-Token response
709 + header upon successful creation of a new lock. As a workaround, we
710 + will try to pick the lock token from the response body (although
711 + this is not 100% safe in case of multiple activelocks). */
713 + NE_DEBUG(NE_DBG_LOCKS,
714 + "Ignoring missing LOCK response Lock-Token header\n");
716 + if (token != NULL) {
717 + if (token[0] == '<') token++;
718 + ctx->token = ne_strdup(token);
719 + ne_shave(ctx->token, ">");
720 + NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n",
725 ne_xml_set_error(ctx->parser,
726 _("LOCK response missing Lock-Token header"));
727 @@ -590,12 +607,28 @@
728 ne_shave(ctx->token, ">");
729 NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n",
734 /* TODO: only accept 'prop' as root for LOCK response */
735 if (!can_accept(parent, id))
736 return NE_XML_DECLINE;
738 +#ifdef IIS_LOCK_BUG_WORKAROUND
739 + if (id == ELM_activelock && ctx->found) {
740 + /* Found another activelock... */
741 + const char *token = ne_get_response_header(ctx->req, "Lock-Token");
742 + if (token == NULL) {
743 + /* Response contains more than one activelock and no Lock-Token
744 + * response header. We are doomed. No safe workaround for IIS
745 + * lock bug possible. */
746 + ne_xml_set_error(ctx->parser,
747 + _("LOCK response missing Lock-Token header and more than one activelock"));
748 + return NE_XML_ABORT;
753 if (id == ELM_activelock && !ctx->found) {
754 /* a new activelock */
755 ne_lock_free(&ctx->active);
759 if (state == ELM_activelock) {
760 +#ifdef IIS_LOCK_BUG_WORKAROUND
761 + if (ctx->active.token) {
762 + ctx->token = ne_strdup(ctx->active.token);
764 if (ctx->active.token && strcmp(ctx->active.token, ctx->token) == 0) {
769 --- misc/neon-0.29.5/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100
770 +++ misc/build/neon-0.29.5/src/ne_locks.h 2011-02-03 10:26:21.000000000 +0100
775 +# if defined __GNUC__
776 +# pragma GCC system_header
779 #include "ne_request.h" /* for ne_session + ne_request */
780 #include "ne_uri.h" /* for ne_uri */
782 --- misc/neon-0.29.5/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200
783 +++ misc/build/neon-0.29.5/src/ne_sspi.c 2011-02-03 10:26:21.000000000 +0100
788 + * Simplification wrapper arround AcquireCredentialsHandle as most of
789 + * the parameters do not change.
791 +static int acquireCredentialsHandleForUsername(CredHandle * credentials, char *package, const char *username, const char *password)
793 + SECURITY_STATUS status;
794 + TimeStamp timestamp;
796 + const char *domain = "";
799 + SecPkgInfo *secPackInfo;
800 + SEC_WINNT_AUTH_IDENTITY *nameAndPwd = NULL;
801 + int bytesReceived = 0, bytesSent = 0;
803 + nameAndPwd = (SEC_WINNT_AUTH_IDENTITY *) malloc( sizeof(SEC_WINNT_AUTH_IDENTITY) );
804 + memset( nameAndPwd, '\0', sizeof (*nameAndPwd) );
805 + nameAndPwd->Domain = (unsigned char *) _strdup( domain? domain: "" );
806 + nameAndPwd->DomainLength = domain? strlen( domain ): 0;
807 + nameAndPwd->User = (unsigned char *) _strdup( username? username: "" );
808 + nameAndPwd->UserLength = username? strlen( username ): 0;
809 + nameAndPwd->Password = (unsigned char *) _strdup( password? password: "" );
810 + nameAndPwd->PasswordLength = password? strlen( password ): 0;
811 + nameAndPwd->Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
813 + status = pSFT->AcquireCredentialsHandle( NULL, package, SECPKG_CRED_OUTBOUND,
814 + NULL, nameAndPwd, NULL, NULL, credentials, ×tamp );
816 + if (status != SEC_E_OK) {
817 + NE_DEBUG(NE_DBG_HTTPAUTH,
818 + "sspi: AcquireCredentialsHandle [fail] [%x].\n", status);
827 * Wrapper arround initializeSecurityContext. Supplies several
828 * default parameters as well as logging in case of errors.
831 * Processes received authentication tokens as well as supplies the
834 -int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken)
835 +int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken, const char* username, const char* password)
837 SecBufferDesc outBufferDesc;
839 @@ -561,13 +600,22 @@
840 /* Reset any existing context since we are starting over */
841 resetContext(sspiContext);
843 - if (acquireCredentialsHandle
844 - (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
845 - freeBuffer(&outBufferDesc);
846 - NE_DEBUG(NE_DBG_HTTPAUTH,
847 - "sspi: acquireCredentialsHandle failed.\n");
850 + if (strlen(username) != 0) {
851 + if (acquireCredentialsHandleForUsername
852 + (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) {
853 + freeBuffer(&outBufferDesc);
854 + NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandleForUsername failed.\n");
858 + if (acquireCredentialsHandle
859 + (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
860 + freeBuffer(&outBufferDesc);
861 + NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandle failed.\n");
868 initializeSecurityContext(&sspiContext->credentials, NULL,
869 --- misc/neon-0.29.5/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100
870 +++ misc/build/neon-0.29.5/src/ne_sspi.h 2011-02-03 10:26:21.000000000 +0100
872 int ne_sspi_clear_context(void *context);
874 int ne_sspi_authenticate(void *context, const char *base64Token,
875 - char **responseToken);
876 + char **responseToken, const char* username, const char* password);
878 #endif /* HAVE_SSPI */
880 --- misc/neon-0.29.5/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100
881 +++ misc/build/neon-0.29.5/src/ne_uri.c 2011-02-03 10:26:21.000000000 +0100
883 #include "ne_alloc.h"
886 -/* URI ABNF from RFC 3986: */
887 +/* URI ABNF from RFC 3986: (TKR: SharePoint is contradictory to this RFC. So I fix it here. )*/
889 #define PS (0x0001) /* "+" */
890 #define PC (0x0002) /* "%" */
893 #define OT (0x4000) /* others */
895 +/* TKR new symbol */
896 +#define WS (0x8000) /* Whitespaces ( Space, Tab ) */
898 #define URI_ALPHA (AL)
899 #define URI_DIGIT (DG)
902 /* pchar = unreserved / pct-encoded / sub-delims / ":" / "@" */
903 #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT)
904 /* invented: segchar = pchar / "/" */
905 -#define URI_SEGCHAR (URI_PCHAR | FS)
906 +/* (TKR) WS added */
907 +#define URI_SEGCHAR (URI_PCHAR | FS | WS)
908 /* query = *( pchar / "/" / "?" ) */
909 #define URI_QUERY (URI_PCHAR | FS | QU)
910 /* fragment == query */
911 #define URI_FRAGMENT URI_QUERY
913 /* any characters which should be path-escaped: */
914 -#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | PC)
915 +#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | WS | PC)
917 static const unsigned int uri_chars[256] = {
918 /* 0xXX x0 x2 x4 x6 x8 xA xC xE */
919 -/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
920 +/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, WS, OT, OT, OT, OT, OT, OT,
921 /* 1x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
922 -/* 2x */ OT, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
923 +/* 2x */ WS, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
924 /* 3x */ DG, DG, DG, DG, DG, DG, DG, DG, DG, DG, CL, SD, OT, SD, OT, QU,
925 /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL,
926 /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US,
927 --- misc/neon-0.29.5/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100
928 +++ misc/build/neon-0.29.5/src/ne_utils.c 2011-02-03 10:26:21.000000000 +0100
931 ", GNU TLS " LIBGNUTLS_VERSION
932 #endif /* HAVE_GNUTLS */
935 +#endif /* HAVE_SSPI */
941 #if defined(NE_HAVE_SSL) || defined(NE_HAVE_ZLIB) || defined(NE_HAVE_IPV6) \
942 || defined(NE_HAVE_SOCKS) || defined(NE_HAVE_LFS) \
943 - || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N)
944 + || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N) || defined(HAVE_SSPI)
950 case NE_FEATURE_I18N:
953 + case NE_FEATURE_SSPI:
956 #endif /* NE_HAVE_* */
958 --- misc/neon-0.29.5/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200
959 +++ misc/build/neon-0.29.5/src/ne_utils.h 2011-02-03 10:26:21.000000000 +0100
961 #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */
962 #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */
963 #define NE_FEATURE_I18N (7) /* i18n error message support */
964 +#define NE_FEATURE_SSPI (8) /* NTLM/Negotiate authentication protocol via SSPI */
966 /* Returns non-zero if library is built with support for the given
967 * NE_FEATURE_* feature code 'code'. */