patch-src_webdav_c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --- davfs2-1.4.7.orig/src/webdav.c 2012-07-19 13:27:51.000000000 +0200
  2. +++ davfs2-1.4.7/src/webdav.c 2014-01-01 20:14:54.000000000 +0100
  3. @@ -21,7 +21,6 @@
  4. #include "config.h"
  5. #include <errno.h>
  6. -#include <error.h>
  7. #ifdef HAVE_FCNTL_H
  8. #include <fcntl.h>
  9. #endif
  10. @@ -52,6 +51,8 @@
  11. #include <sys/stat.h>
  12. #endif
  13. +#include <regex.h>
  14. +
  15. #include <ne_alloc.h>
  16. #include <ne_auth.h>
  17. #include <ne_basic.h>
  18. @@ -1921,6 +1922,7 @@ quota_result(void *userdata, const ne_ur
  19. static int
  20. ssl_verify(void *userdata, int failures, const ne_ssl_certificate *cert)
  21. {
  22. + regex_t *re;
  23. char *issuer = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert));
  24. char *subject = ne_ssl_readable_dname(ne_ssl_cert_subject(cert));
  25. char *digest = ne_calloc(NE_SSL_DIGESTLEN);
  26. @@ -1967,8 +1969,13 @@ ssl_verify(void *userdata, int failures,
  27. len = getline(&s, &n, stdin);
  28. if (len < 0)
  29. abort();
  30. - if (rpmatch(s) > 0)
  31. - ret = 0;
  32. + if (regcomp(&re, "^[yY]", REG_EXTENDED) != 0) {
  33. + if (regexec(&re, s, (size_t)0, NULL, 0) < 1) {
  34. + regfree(&re);
  35. + ret = -1;
  36. + }
  37. + ret = 0;
  38. + }
  39. free(s);
  40. }