patch-src_webdav_c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --- davfs2-1.4.6.orig/src/webdav.c 2010-02-16 20:29:59.000000000 +0100
  2. +++ davfs2-1.4.6/src/webdav.c 2010-05-30 09:52:01.161613627 +0200
  3. @@ -52,6 +52,8 @@
  4. #include <sys/stat.h>
  5. #endif
  6. +#include <regex.h>
  7. +
  8. #include <ne_alloc.h>
  9. #include <ne_auth.h>
  10. #include <ne_basic.h>
  11. @@ -1918,6 +1920,7 @@ quota_result(void *userdata, const ne_ur
  12. static int
  13. ssl_verify(void *userdata, int failures, const ne_ssl_certificate *cert)
  14. {
  15. + regex_t *re;
  16. char *issuer = ne_ssl_readable_dname(ne_ssl_cert_issuer(cert));
  17. char *subject = ne_ssl_readable_dname(ne_ssl_cert_subject(cert));
  18. char *digest = ne_calloc(NE_SSL_DIGESTLEN);
  19. @@ -1964,8 +1967,13 @@ ssl_verify(void *userdata, int failures,
  20. len = getline(&s, &n, stdin);
  21. if (len < 0)
  22. abort();
  23. - if (rpmatch(s) > 0)
  24. - ret = 0;
  25. + if (regcomp(&re, "^[yY]", REG_EXTENDED) != 0) {
  26. + if (regexec(&re, s, (size_t)0, NULL, 0) < 1) {
  27. + regfree(&re);
  28. + ret = -1;
  29. + }
  30. + ret = 0;
  31. + }
  32. free(s);
  33. }