Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
msrex opened this issue Dec 14, 2012 · 3 comments
Closed

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

msrex opened this issue Dec 14, 2012 · 3 comments

Comments

@msrex
Copy link

msrex commented Dec 14, 2012

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?

@ghost ghost assigned butonic Jan 14, 2013
@butonic
Copy link
Member

butonic commented Feb 21, 2013

@icewind1991 this shold not be possible with the new filecache. can you confirm?

@icewind1991
Copy link
Contributor

This shouldn't be a problem with the new cache, paths are normalized as one of the first steps in the api

@jancborchardt
Copy link
Member

I’m closing this issue because it has been inactive for a few months. This probably means it’s not reproducible or it has been fixed in a newer version.

Please reopen if the error still persists with the latest stable version (currently ownCloud 5.0.9) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants