patch-src_webdav_c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. $Id$
  2. cf. http://sourceforge.net/tracker/index.php?func=detail&aid=1594808&group_id=26275&atid=386747
  3. --- davfs2-1.3.3.orig/src/webdav.c 2008-06-28 19:20:07.000000000 +0200
  4. +++ davfs2-1.3.3/src/webdav.c 2008-12-08 00:37:23.000000000 +0100
  5. @@ -23,7 +23,6 @@
  6. #include "config.h"
  7. -#include <argz.h>
  8. #include <errno.h>
  9. #include <error.h>
  10. #include <fcntl.h>
  11. @@ -34,6 +33,7 @@
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include <syslog.h>
  15. +#include <regex.h>
  16. #include <time.h>
  17. #include <unistd.h>
  18. @@ -406,6 +406,11 @@ void dav_init_webdav(const char *scheme,
  19. suri = (ne_uri *) ne_calloc(sizeof(ne_uri));
  20. ne_fill_server_uri(session, suri);
  21. + /* begin of GMX hack */
  22. + ne_server_capabilities caps;
  23. + ne_options(session, "/", &caps);
  24. + /* end of GMX hack */
  25. +
  26. if (use_locks) {
  27. locks = ne_lockstore_create();
  28. if (lock_owner == NULL) {
  29. @@ -1859,13 +1864,18 @@ static int ssl_verify(void *userdata, in
  30. "or there might be a man-in-the-middle-attack.\n"));
  31. printf(_("Accept certificate for this session? [y,N] "));
  32. char *s = NULL;
  33. + regex_t *re;
  34. size_t n = 0;
  35. ssize_t len = 0;
  36. len = getline(&s, &n, stdin);
  37. if (len < 0)
  38. abort();
  39. - if (rpmatch(s) < 1)
  40. - ret = -1;
  41. + if (regcomp(&re, "^[yY]", REG_EXTENDED) != 0) {
  42. + if (regexec(&re, s, (size_t)0, NULL, 0) < 1) {
  43. + regfree(&re);
  44. + ret = -1;
  45. + }
  46. + }
  47. free(s);
  48. }
  49. }