merged tag ooo/OOO330_m14
[LibreOffice.git] / neon / neon.patch
blob3d4e5019e0b77b45c4fb4064d62add2a0b159110
1 --- misc/neon-0.29.3/src/config.h 2010-03-23 14:47:43.000000000 +0100
2 +++ misc/build/neon-0.29.3/src/config.h 2010-03-23 12:19:50.000000000 +0100
3 @@ -1 +1,488 @@
4 -dummy
6 +/* Define to specific EGD socket path */
7 +/* #undef EGD_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. */
16 +#ifdef UNX
17 +#define HAVE_ARPA_INET_H 1
18 +#endif
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
24 + don't. */
25 +#ifdef WIN32
26 +#define HAVE_DECL_H_ERRNO 1
27 +#endif
29 +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
30 + */
31 +#ifdef LINUX
32 +#define HAVE_DECL_STPCPY 1
33 +#endif
35 +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
36 + don't. */
37 +#ifdef LINUX
38 +#define HAVE_DECL_STRERROR_R 1
39 +#endif
41 +/* Define to 1 if you have the <dlfcn.h> header file. */
42 +#ifdef UNX
43 +#define HAVE_DLFCN_H 1
44 +#endif
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. */
53 +#define HAVE_FSTAT64
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. */
83 +#ifdef UNX
84 +#define HAVE_INET_NTOP 1
85 +#endif
87 +/* Define to 1 if you have the <inttypes.h> header file. */
88 +#ifdef UNX
89 +#define HAVE_INTTYPES_H 1
90 +#endif
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. */
120 +#ifdef UNX
121 +#define HAVE_NETDB_H 1
122 +#endif
124 +/* Define to 1 if you have the <netinet/in.h> header file. */
125 +#ifdef UNX
126 +#define HAVE_NETINET_IN_H 1
127 +#endif
129 +/* Define to 1 if you have the <netinet/tcp.h> header file. */
130 +#ifdef UNX
131 +#define HAVE_NETINET_TCP_H 1
132 +#endif
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. */
144 +#define HAVE_PIPE 1
146 +/* Define to 1 if you have the `poll' function. */
147 +#define HAVE_POLL 1
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
161 +#endif
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. */
167 +#ifdef LINUX
168 +#define HAVE_SHUTDOWN 1
169 +#endif
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. */
178 +#ifdef UNX
179 +#define HAVE_SNPRINTF 1
180 +#endif
182 +#ifdef WIN32
183 +#define snprintf _snprintf
184 +#endif
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. */
199 +#ifdef LINUX
200 +#define HAVE_STPCPY 1
201 +#endif
203 +/* Define to 1 if you have the `strcasecmp' function. */
204 +#ifdef UNX
205 +#define HAVE_STRCASECMP 1
206 +#endif
208 +#ifdef WIN32
209 +#define strcasecmp strcmpi
210 +#endif
212 +/* Define to 1 if you have the `strerror_r' function. */
213 +#ifdef LINUX
214 +#define HAVE_STRERROR_R 1
215 +#endif
217 +/* Define to 1 if you have the <strings.h> header file. */
218 +#ifdef UNX
219 +#define HAVE_STRINGS_H 1
220 +#endif
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'. */
232 +#ifdef LINUX
233 +#define HAVE_STRUCT_TM_TM_GMTOFF 1
234 +#endif
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. */
243 +#ifdef UNX
244 +#define HAVE_SYS_POLL_H 1
245 +#endif
247 +/* Define to 1 if you have the <sys/select.h> header file. */
248 +#ifdef UNX
249 +#define HAVE_SYS_SELECT_H 1
250 +#endif
252 +/* Define to 1 if you have the <sys/socket.h> header file. */
253 +#ifdef UNX
254 +#define HAVE_SYS_SOCKET_H 1
255 +#endif
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. */
261 +#ifdef UNX
262 +#define HAVE_SYS_TIME_H 1
263 +#endif
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 */
269 +#ifndef MACOSX
270 +#define HAVE_TIMEZONE 1
271 +#endif
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. */
280 +#ifdef UNX
281 +#define HAVE_UNISTD_H 1
282 +#endif
284 +/* Define to 1 if you have the `usleep' function. */
285 +#ifdef UNX
286 +#define HAVE_USLEEP 1
287 +#endif
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
292 +#endif
294 +#ifdef WIN32
295 +#if (defined(_MSC_VER) && (_MSC_VER < 1500)) || defined(__MINGW32__)
296 +#define vsnprintf _vsnprintf
297 +#endif
298 +#endif
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.3"
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 */
343 +#define NE_HAVE_SSL
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 */
355 +#ifdef UNX
356 +#define NE_USE_POLL 1
357 +#endif
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 (3)
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.3"
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.3"
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. */
408 +#ifdef SOLARIS
409 +#define STDC_HEADERS 1
410 +#endif
412 +/* Define to 1 if strerror_r returns char *. */
413 +#ifdef LINUX
414 +#define STRERROR_R_CHAR_P 1
415 +#endif
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
430 +#endif
432 +/* Always defined to enable GNU extensions */
433 +#define _GNU_SOURCE 1
435 +/* Define to empty if `const' does not conform to ANSI C. */
436 +/* #undef const */
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. */
443 +#ifndef __cplusplus
444 +#if defined (SOLARIS) && defined (__SUNPRO_C)
445 +#define inline
446 +#endif
447 +#endif
449 +/* Define to `long' if <sys/types.h> does not define. */
450 +/* #undef off_t */
452 +/* Define to `int' if <sys/types.h> does not define. */
453 +/* #undef pid_t */
455 +/* Define to `unsigned' if <sys/types.h> does not define. */
456 +/* #undef size_t */
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 */
464 +#ifdef NEON_MEMLEAK
465 +# include "memleak.h"
466 +#endif
468 +#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy)
469 +char *stpcpy(char *, const char *);
470 +#endif
472 +#ifdef WIN32
474 +#include <io.h>
476 +#define HAVE_MEMCPY 1
478 +#define strncasecmp strnicmp
479 +#define inline __inline
480 +#define WIN32_LEAN_AND_MEAN
481 +#define NOUSER
482 +#define NOGDI
483 +#define NONLS
484 +#define NOCRYPT
486 +#endif
488 +#ifdef WIN32
489 +#define HAVE_SSPI 1
490 +#else
491 +#define HAVE_NTLM 1
492 +#endif
493 --- misc/neon-0.29.3/src/makefile.mk 2010-03-23 14:47:43.000000000 +0100
494 +++ misc/build/neon-0.29.3/src/makefile.mk 2010-03-23 14:45:21.000000000 +0100
495 @@ -1 +1,102 @@
496 -dummy
497 +PRJ=..$/..$/..$/..$/..
499 +PRJNAME=neon
500 +TARGET=neon
501 +LIBTARGET=NO
502 +USE_DEFFILE=TRUE
503 +NO_DEFAULT_STL=TRUE
504 +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
505 +UWINAPILIB=
507 +# --- Settings -----------------------------------------------------
509 +.INCLUDE : settings.mk
511 +# --- Files --------------------------------------------------------
513 +CDEFS+=-DHAVE_CONFIG_H
515 +.IF "$(SYSTEM_LIBXML)" == "YES"
516 +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
517 +.ELSE
518 +LIBXMLINCDIR=external$/libxml
519 +CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXMLINCDIR)
520 +.ENDIF
522 +.IF "$(SYSTEM_OPENSSL)" == "YES"
523 +CFLAGS+= $(OPENSSL_CFLAGS)
524 +.ENDIF
526 +.IF "$(SYSTEM_ZLIB)" == "YES"
527 +CFLAGS+=-DSYSTEM_ZLIB
528 +.ELSE
529 +ZLIBINCDIR=external$/zlib
530 +CFLAGS+=-I$(SOLARINCDIR)$/$(ZLIBINCDIR)
531 +.ENDIF
533 +SLOFILES= \
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
557 +.IF "$(OS)"=="WNT"
558 +SLOFILES+=$(SLO)$/ne_sspi.obj
559 +.ELSE
560 +SLOFILES+=$(SLO)$/ne_ntlm.obj
561 +.ENDIF
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) \
572 + $(ZLIB3RDLIB)
574 +.IF "$(GUI)"=="WNT"
575 + SHL1STDLIBS+= $(WSOCK32LIB)
576 + .IF "$(WINDOWS_VISTA_PSDK)" != ""
577 + SHL1STDLIBS+= $(WS2_32LIB)
578 + .ENDIF
579 + SHL1STDLIBS+= $(OPENSSLLIB)
580 +.ELSE # WNT
581 + .IF "$(OS)"=="SOLARIS"
582 + SHL1STDLIBS+= -lnsl -lsocket -ldl
583 + .ENDIF # SOLARIS
584 + .IF "$(OS)"=="OS2"
585 + SHL1STDLIBS+= pthread.lib libz.lib
586 + .ENDIF # OS2
587 + .IF "$(SYSTEM_OPENSSL)"=="YES"
588 + SHL1STDLIBS+= $(OPENSSLLIB)
589 + .ELSE
590 + SHL1STDLIBS+= $(OPENSSLLIBST)
591 + .ENDIF
592 +.ENDIF # WNT
594 +SHL1DEF=$(MISC)$/$(SHL1TARGET).def
596 +# --- Targets ------------------------------------------------------
597 +DEF1NAME=$(SHL1TARGET)
598 +.INCLUDE : target.mk
599 --- misc/neon-0.29.3/src/ne_auth.c 2009-12-30 22:29:30.000000000 +0100
600 +++ misc/build/neon-0.29.3/src/ne_auth.c 2010-03-23 12:19:50.000000000 +0100
601 @@ -367,7 +367,7 @@
602 static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt,
603 struct auth_challenge *chall, char *pwbuf)
605 - if (chall->handler->creds(chall->handler->userdata, sess->realm,
606 + if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm,
607 chall->handler->attempt++, sess->username, pwbuf) == 0) {
608 return 0;
609 } else {
610 @@ -617,6 +617,7 @@
611 int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
612 int status;
613 char *response = NULL;
614 + char password[NE_ABUFSIZ];
616 NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n");
618 @@ -633,8 +634,17 @@
619 return status;
623 + /* Authentification needs more than one http request.
624 + * As long as authentification in progress use the existing credentials.
625 + * Otherwise get new credentials.*/
626 + if (!parms->opaque)
627 + if (get_credentials(sess, errmsg, attempt, parms, password)) {
628 + /* Failed to get credentials */
629 + return -1;
632 - status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response);
633 + status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response, sess->username, password);
634 if (status) {
635 return status;
637 --- misc/neon-0.29.3/src/ne_auth.h 2009-09-01 22:13:12.000000000 +0200
638 +++ misc/build/neon-0.29.3/src/ne_auth.h 2010-03-23 12:19:50.000000000 +0100
639 @@ -47,8 +47,8 @@
640 * Hint: if you just wish to attempt authentication just once (even if
641 * the user gets the username/password wrong), have the callback
642 * function use 'attempt' value as the function return value. */
643 -typedef int (*ne_auth_creds)(void *userdata, const char *realm, int attempt,
644 - char *username, char *password);
645 +typedef int (*ne_auth_creds)(void *userdata, const char * auth_protocol,
646 + const char *realm, int attempt, char *username, char *password);
648 /* Set callbacks to provide credentials for server and proxy
649 * authentication, using the default set of authentication protocols.
650 --- misc/neon-0.29.3/src/ne_defs.h 2009-09-02 16:04:43.000000000 +0200
651 +++ misc/build/neon-0.29.3/src/ne_defs.h 2010-03-23 12:19:50.000000000 +0100
652 @@ -41,7 +41,7 @@
653 #endif
655 /* define ssize_t for Win32 */
656 -#if defined(WIN32) && !defined(ssize_t)
657 +#if defined(WIN32) && !defined(ssize_t) && !defined(__MINGW32__)
658 #define ssize_t int
659 #endif
661 --- misc/neon-0.29.3/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100
662 +++ misc/build/neon-0.29.3/src/ne_locks.c 2010-03-23 12:19:50.000000000 +0100
663 @@ -579,6 +579,23 @@
664 const char *token = ne_get_response_header(ctx->req, "Lock-Token");
665 /* at the root element; retrieve the Lock-Token header,
666 * and bail if it wasn't given. */
667 +#ifdef IIS_LOCK_BUG_WORKAROUND
668 + /* MS IIS violates RFC 2518/4918. It does not send a Lock-Token response
669 + header upon successful creation of a new lock. As a workaround, we
670 + will try to pick the lock token from the response body (although
671 + this is not 100% safe in case of multiple activelocks). */
672 + if (token == NULL)
673 + NE_DEBUG(NE_DBG_LOCKS,
674 + "Ignoring missing LOCK response Lock-Token header\n");
676 + if (token != NULL) {
677 + if (token[0] == '<') token++;
678 + ctx->token = ne_strdup(token);
679 + ne_shave(ctx->token, ">");
680 + NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n",
681 + ctx->token);
683 +#else
684 if (token == NULL) {
685 ne_xml_set_error(ctx->parser,
686 _("LOCK response missing Lock-Token header"));
687 @@ -590,12 +607,28 @@
688 ne_shave(ctx->token, ">");
689 NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n",
690 ctx->token);
691 +#endif
694 /* TODO: only accept 'prop' as root for LOCK response */
695 if (!can_accept(parent, id))
696 return NE_XML_DECLINE;
698 +#ifdef IIS_LOCK_BUG_WORKAROUND
699 + if (id == ELM_activelock && ctx->found) {
700 + /* Found another activelock... */
701 + const char *token = ne_get_response_header(ctx->req, "Lock-Token");
702 + if (token == NULL) {
703 + /* Response contains more than one activelock and no Lock-Token
704 + * response header. We are doomed. No safe workaround for IIS
705 + * lock bug possible. */
706 + ne_xml_set_error(ctx->parser,
707 + _("LOCK response missing Lock-Token header and more than one activelock"));
708 + return NE_XML_ABORT;
711 +#endif
713 if (id == ELM_activelock && !ctx->found) {
714 /* a new activelock */
715 ne_lock_free(&ctx->active);
716 @@ -621,7 +654,12 @@
717 return -1;
719 if (state == ELM_activelock) {
720 +#ifdef IIS_LOCK_BUG_WORKAROUND
721 + if (ctx->active.token) {
722 + ctx->token = ne_strdup(ctx->active.token);
723 +#else
724 if (ctx->active.token && strcmp(ctx->active.token, ctx->token) == 0) {
725 +#endif
726 ctx->found = 1;
729 --- misc/neon-0.29.3/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100
730 +++ misc/build/neon-0.29.3/src/ne_locks.h 2010-03-23 12:19:50.000000000 +0100
731 @@ -22,6 +22,10 @@
732 #ifndef NE_LOCKS_H
733 #define NE_LOCKS_H
735 +# if defined __GNUC__
736 +# pragma GCC system_header
737 +# endif
739 #include "ne_request.h" /* for ne_session + ne_request */
740 #include "ne_uri.h" /* for ne_uri */
742 --- misc/neon-0.29.3/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200
743 +++ misc/build/neon-0.29.3/src/ne_sspi.c 2010-03-23 12:19:50.000000000 +0100
744 @@ -206,6 +206,45 @@
748 + * Simplification wrapper arround AcquireCredentialsHandle as most of
749 + * the parameters do not change.
750 + */
751 +static int acquireCredentialsHandleForUsername(CredHandle * credentials, char *package, const char *username, const char *password)
753 + SECURITY_STATUS status;
754 + TimeStamp timestamp;
756 + const char *domain = "";
758 + int rc, rcISC;
759 + SecPkgInfo *secPackInfo;
760 + SEC_WINNT_AUTH_IDENTITY *nameAndPwd = NULL;
761 + int bytesReceived = 0, bytesSent = 0;
763 + nameAndPwd = (SEC_WINNT_AUTH_IDENTITY *) malloc( sizeof(SEC_WINNT_AUTH_IDENTITY) );
764 + memset( nameAndPwd, '\0', sizeof (*nameAndPwd) );
765 + nameAndPwd->Domain = (unsigned char *) _strdup( domain? domain: "" );
766 + nameAndPwd->DomainLength = domain? strlen( domain ): 0;
767 + nameAndPwd->User = (unsigned char *) _strdup( username? username: "" );
768 + nameAndPwd->UserLength = username? strlen( username ): 0;
769 + nameAndPwd->Password = (unsigned char *) _strdup( password? password: "" );
770 + nameAndPwd->PasswordLength = password? strlen( password ): 0;
771 + nameAndPwd->Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
773 + status = pSFT->AcquireCredentialsHandle( NULL, package, SECPKG_CRED_OUTBOUND,
774 + NULL, nameAndPwd, NULL, NULL, credentials, &timestamp );
776 + if (status != SEC_E_OK) {
777 + NE_DEBUG(NE_DBG_HTTPAUTH,
778 + "sspi: AcquireCredentialsHandle [fail] [%x].\n", status);
779 + return -1;
782 + return 0;
787 * Wrapper arround initializeSecurityContext. Supplies several
788 * default parameters as well as logging in case of errors.
790 @@ -483,7 +522,7 @@
791 * Processes received authentication tokens as well as supplies the
792 * response token.
794 -int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken)
795 +int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken, const char* username, const char* password)
797 SecBufferDesc outBufferDesc;
798 SecBuffer outBuffer;
799 @@ -561,13 +600,22 @@
800 /* Reset any existing context since we are starting over */
801 resetContext(sspiContext);
803 - if (acquireCredentialsHandle
804 - (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
805 - freeBuffer(&outBufferDesc);
806 - NE_DEBUG(NE_DBG_HTTPAUTH,
807 - "sspi: acquireCredentialsHandle failed.\n");
808 - return -1;
810 + if (strlen(username) != 0) {
811 + if (acquireCredentialsHandleForUsername
812 + (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) {
813 + freeBuffer(&outBufferDesc);
814 + NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandleForUsername failed.\n");
815 + return -1;
817 + } else {
818 + if (acquireCredentialsHandle
819 + (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
820 + freeBuffer(&outBufferDesc);
821 + NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandle failed.\n");
822 + return -1;
827 securityStatus =
828 initializeSecurityContext(&sspiContext->credentials, NULL,
829 --- misc/neon-0.29.3/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100
830 +++ misc/build/neon-0.29.3/src/ne_sspi.h 2010-03-23 12:19:50.000000000 +0100
831 @@ -41,7 +41,7 @@
832 int ne_sspi_clear_context(void *context);
834 int ne_sspi_authenticate(void *context, const char *base64Token,
835 - char **responseToken);
836 + char **responseToken, const char* username, const char* password);
838 #endif /* HAVE_SSPI */
840 --- misc/neon-0.29.3/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100
841 +++ misc/build/neon-0.29.3/src/ne_uri.c 2010-03-23 12:19:50.000000000 +0100
842 @@ -42,7 +42,7 @@
843 #include "ne_alloc.h"
844 #include "ne_uri.h"
846 -/* URI ABNF from RFC 3986: */
847 +/* URI ABNF from RFC 3986: (TKR: SharePoint is contradictory to this RFC. So I fix it here. )*/
849 #define PS (0x0001) /* "+" */
850 #define PC (0x0002) /* "%" */
851 @@ -67,6 +67,9 @@
853 #define OT (0x4000) /* others */
855 +/* TKR new symbol */
856 +#define WS (0x8000) /* Whitespaces ( Space, Tab ) */
858 #define URI_ALPHA (AL)
859 #define URI_DIGIT (DG)
861 @@ -83,20 +86,21 @@
862 /* pchar = unreserved / pct-encoded / sub-delims / ":" / "@" */
863 #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT)
864 /* invented: segchar = pchar / "/" */
865 -#define URI_SEGCHAR (URI_PCHAR | FS)
866 +/* (TKR) WS added */
867 +#define URI_SEGCHAR (URI_PCHAR | FS | WS)
868 /* query = *( pchar / "/" / "?" ) */
869 #define URI_QUERY (URI_PCHAR | FS | QU)
870 /* fragment == query */
871 #define URI_FRAGMENT URI_QUERY
873 /* any characters which should be path-escaped: */
874 -#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | PC)
875 +#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | WS | PC)
877 static const unsigned int uri_chars[256] = {
878 /* 0xXX x0 x2 x4 x6 x8 xA xC xE */
879 -/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
880 +/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, WS, OT, OT, OT, OT, OT, OT,
881 /* 1x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
882 -/* 2x */ OT, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
883 +/* 2x */ WS, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
884 /* 3x */ DG, DG, DG, DG, DG, DG, DG, DG, DG, DG, CL, SD, OT, SD, OT, QU,
885 /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL,
886 /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US,
887 --- misc/neon-0.29.3/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100
888 +++ misc/build/neon-0.29.3/src/ne_utils.c 2010-03-23 12:19:50.000000000 +0100
889 @@ -118,6 +118,9 @@
890 #ifdef HAVE_GNUTLS
891 ", GNU TLS " LIBGNUTLS_VERSION
892 #endif /* HAVE_GNUTLS */
893 +#ifdef HAVE_SSPI
894 + ", SSPI"
895 +#endif /* HAVE_SSPI */
899 @@ -137,7 +140,7 @@
900 switch (feature) {
901 #if defined(NE_HAVE_SSL) || defined(NE_HAVE_ZLIB) || defined(NE_HAVE_IPV6) \
902 || defined(NE_HAVE_SOCKS) || defined(NE_HAVE_LFS) \
903 - || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N)
904 + || defined(NE_HAVE_TS_SSL) || defined(NE_HAVE_I18N) || defined(HAVE_SSPI)
905 #ifdef NE_HAVE_SSL
906 case NE_FEATURE_SSL:
907 #endif
908 @@ -159,6 +162,9 @@
909 #ifdef NE_HAVE_I18N
910 case NE_FEATURE_I18N:
911 #endif
912 +#ifdef HAVE_SSPI
913 + case NE_FEATURE_SSPI:
914 +#endif
915 return 1;
916 #endif /* NE_HAVE_* */
917 default:
918 --- misc/neon-0.29.3/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200
919 +++ misc/build/neon-0.29.3/src/ne_utils.h 2010-03-23 12:19:50.000000000 +0100
920 @@ -54,6 +54,7 @@
921 #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */
922 #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */
923 #define NE_FEATURE_I18N (7) /* i18n error message support */
924 +#define NE_FEATURE_SSPI (8) /* NTLM/Negotiate authentication protocol via SSPI */
926 /* Returns non-zero if library is built with support for the given
927 * NE_FEATURE_* feature code 'code'. */