Skip to content

oc-1880 - Duplicate entry in fscache and as a result Web Interface  #892

Description

@msrex

From http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-1880

@dragotin @icewind1991 @butonic - is that fixed?

Description:
filesystem cache routine seem not to normalize filenames on write. That leads to duplicate file appearance in the fscache-table and the web interface. If for example the sync client or a webdav client PUTs on a filename like /test//foo.bar it is not considered the same file as /test/foo.bar

The fullpath name should be normalized.

Reproduction steps:
PUT on a file once and than on the same file name with doubled slashes somewhere
#4 Comment posted by freitag Oct 01, 07:34

A file was uploaded.
doublicates on web interface
doublicates on web interfaceicon_open_new.png
#5 Comment posted by freitag Oct 04, 09:32

The same effect can be seen on the freenet test installation.
#6 Comment posted by Jörn Dreyer Oct 09, 11:59

I just debugged the freenet issue. It is caused by the OC_Cache::getUserCache to return -1 for the file id. In getID I got it working with adding a check for -1:

@line 282 in lib/filecache.php

    $fullPath=$root.$path;
        if(($cache=OC_Cache::getUserCache(true)) && $cache->hasKey('fileid/'.$fullPath)) {
-           return $cache->get('fileid/'.$fullPath);
+           $id = $cache->get('fileid/'.$fullPath);
+           if ($id != -1) {
+               return $id;
+           }
        }

the double slashes from the web ui are cleaned up somewhere down the road into the db.

I have not added this as a fix to core but it is working fine at freenet. @robin: it feels like a hack. Is there a saner place to fix this? somewhere in the oc_usercache implementations?

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions