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