Package: fusedav
Version: 0.2-3.1
Severity: important
Tags: upstream patch

Dear Maintainer,

Trying to mount https://webdav.mc.gmx.net/ results in something like
this (using ls -F):
Externe Ordner* Gelöschte Dateien* Meine Bilder* Meine Dokumente* Meine 
Musikdateien* Meine Videos* Neue Dateianlagen* testdir2* test.txt*
I.e. directories are displayed as executable files.
Normal files do work fine though.
The reason is that the service in responses does not terminate
collections with a slash - and this is only a SHOULD in the RFC.
My patch checks instead the resourcetype if it is a collection,
and if so marks it as a directory.
This might have been an oversight as the resourcetype is already
parsed out, just not used for anything...

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (700, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, armel, ppc64el

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages fusedav depends on:
ii  fuse              2.9.3-15+b1
ii  libc6             2.19-18
ii  libfuse2          2.9.3-15+b1
ii  libneon27-gnutls  0.30.1-1

fusedav recommends no packages.

fusedav suggests no packages.

-- no debconf information
>From 4c459ba5070ebaf8fb120b6e97eff18a0473f6b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <reimar.doeffin...@gmx.de>
Date: Fri, 17 Apr 2015 22:52:50 +0200
Subject: [PATCH] Fix directories being misinterpreted as files.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This happens on services that do not follow the RFC
SHOULD of attaching a / to collections.

Signed-off-by: Reimar Döffinger <reimar.doeffin...@gmx.de>
---
 src/fusedav.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/fusedav.c b/src/fusedav.c
index 5620811..99de815 100644
--- a/src/fusedav.c
+++ b/src/fusedav.c
@@ -194,6 +194,12 @@ static void fill_stat(struct stat* st, const ne_prop_result_set *results, int is
     glm = ne_propset_value(results, &getlastmodified);
     cd = ne_propset_value(results, &creationdate);
 
+    // Double-check for collection with RFC-recommended method.
+    // Necessary for e.g. gmx.de.
+    // Note: strcmp doesn't work, needs to use strncmp.
+    if (rt && !strncmp(rt, "<DAV:collection>", 16))
+        is_dir = 1;
+
     memset(st, 0, sizeof(struct stat));
 
     if (is_dir) {
-- 
2.1.4

Reply via email to