Package: davfs2
Version: 0.2.3-2
Severity: normal
Tags: patch

Hi,
directories retrieved via readdir(3) have trailing slashes ('/'). 
This leads to quiet some problems. For example several programs use
strrchr(path,'/') to extract the last directory component leading to a
empty directory in this case (you can verify this by e.g. running gqview
on a webdav mounted directory that has subdirectories). Mozilla and
Firefox simply crash when trying to open a webdav mounted directory that
has subdirs. I think it's fine to simply strip the trailing slash from
directory names since it's no valid in POSIX AFAIK:

Index: src/webdav.c
===================================================================
--- src/webdav.c        (revision 262)
+++ src/webdav.c        (working copy)
@@ -390,6 +390,10 @@
     data = ne_propset_value(set, &stat_props[0]);
     if (data) 
        result->fname = ne_path_unescape(data);
+       /* strip trailing '/' from directories */
+       if (result->fname[strlen(result->fname)] == '/') {
+               result->fname[strlen(result->fname)] = 0;
+       }
     else {
        char *parent = ne_path_parent(uri);
        char *fname;

Cheers,
 -- Guido

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-rc3-agx0
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages davfs2 depends on:
ii  libc6                      2.3.5-4       GNU C Library: Shared libraries an
ii  libneon24                  0.24.7.dfsg-2 An HTTP and WebDAV client library
ii  libssl0.9.7                0.9.7g-1      SSL shared libraries
ii  libxml2                    2.6.20-1      GNOME XML library
ii  zlib1g                     1:1.2.3-3     compression library - runtime

davfs2 recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to