summaryrefslogtreecommitdiff
path: root/package/davfs2/patches/patch-src_webdav_c
blob: 35ad27492b7f131080548b1fc9f5aa6532d237e7 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$Id$

	cf. http://sourceforge.net/tracker/index.php?func=detail&aid=1594808&group_id=26275&atid=386747

--- davfs2-1.3.3.orig/src/webdav.c	2008-06-28 19:20:07.000000000 +0200
+++ davfs2-1.3.3/src/webdav.c	2008-12-08 00:37:23.000000000 +0100
@@ -23,7 +23,6 @@
 
 #include "config.h"
 
-#include <argz.h>
 #include <errno.h>
 #include <error.h>
 #include <fcntl.h>
@@ -34,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
+#include <regex.h>
 #include <time.h>
 #include <unistd.h>
 
@@ -406,6 +406,11 @@ void dav_init_webdav(const char *scheme,
     suri = (ne_uri *) ne_calloc(sizeof(ne_uri));
     ne_fill_server_uri(session, suri);
 
+    /* begin of GMX hack */
+    ne_server_capabilities caps;
+    ne_options(session, "/", &caps);
+    /* end of GMX hack */
+
     if (use_locks) {
         locks = ne_lockstore_create();
         if (lock_owner == NULL) {
@@ -1859,13 +1864,18 @@ static int ssl_verify(void *userdata, in
                      "or there might be a man-in-the-middle-attack.\n"));
             printf(_("Accept certificate for this session? [y,N] "));
             char *s = NULL;
+            regex_t *re;
             size_t n = 0;
             ssize_t len = 0;
             len = getline(&s, &n, stdin);
             if (len < 0)
                 abort();
-            if (rpmatch(s) < 1)
-                ret = -1;
+	    if (regcomp(&re, "^[yY]", REG_EXTENDED) != 0) {
+		if (regexec(&re, s, (size_t)0, NULL, 0) < 1) {
+		        regfree(&re);
+			ret = -1;
+		}
+	    }
             free(s);
         }
     }