core icon indicating copy to clipboard operation
core copied to clipboard

Case sensitivity not handled correctly

Open purigarcia opened this issue 13 years ago • 11 comments

Expected behaviour

If the extension of a file is in capital letters, it should be shown in the web.

Actual behaviour

If the extension of a file is in capital letters, it is not shown in the web. If there are two files photo.jpg and photo.JPG, in the web it looks like you have the same file twice.

Steps to reproduce

  1. Select to upload two file (photo.jpg and photo.JPG)

Server configuration

Operating system: MacOS 10.7.5

Web server: beta.owncloud.com

Database:SQLite3

ownCloud version: 5.0.11 RC2

Browser: Chrome

purigarcia avatar Sep 06 '13 12:09 purigarcia

@owncloud/designers This is forced in css, so this has been a design decision?

Wondering what windows will say to that … @DeepDiver1975 @ringmaster

Niduroki avatar Sep 07 '13 11:09 Niduroki

Interestingly, Windows retains the case information in the filename, but doesn't differentiate between two files with different case. So if I upload a .jpg, then change it to .JPG and upload it again, ownCloud takes them as two separate files. And when I try to download them from ownCloud, I get two differently-cased filenames -- and the case is retained. But if I save them to the same directory, the latter one gets "(1)" appended to the filename because the browser doesn't want to overwrite the existing file with the "same" name.

Really, this isn't a Windows issue. But I agree with the initial report: If the file is uploaded with an extension in specific case, and ownCloud differentiates the cases of extensions internally (it does), then it should display the correct case in the file list.

ringmaster avatar Sep 07 '13 12:09 ringmaster

@ringmaster This is not only true for the extension, but for the entire file name. Windows with VFAT (and Mac OS with default HFS+) are case preserving, while Linux an almost all file systems (with exceptions like JFS, which is only case preserving by default) are case sensitive. Note that also HFS+ filesystems can be defined to be case sensitive, but only during format. Choosing case preservation only was a compatibility measure by Apple AFAIR. According to Wikipedia, Windows with NTFS is a bit more complicated, but from a users POV, it's case preserving (developers might need to be aware of the details though).

The full list is at http://en.wikipedia.org/wiki/Filename#Comparison_of_filename_limitations

The significant difference:

  • Case preserving: foo.bar and FOO.bar can't both exist, they are the same file, yet opening FOO.bar will open foo.bar.
  • Case sensitive: foo.bar and FOO.bar are different files

Note: Except for Windows (and maybe even there), Case preservation vs case sensitivity is a file system trait, not a trait of the operating system! Also important: The same distinction must be made for the backends!

danimo avatar Jan 14 '14 10:01 danimo

Updated previous comment to include some more details.

danimo avatar Jan 14 '14 10:01 danimo

We need to agree on a policy here, since this also affects the clients.

danimo avatar Jan 14 '14 10:01 danimo

@karlitschek @DeepDiver1975

danimo avatar Jan 14 '14 10:01 danimo

From a client and backend POV, the Wikipedia article linked above gives us great criteria that can limiting the syncing process across devices:

  • Case sensitive
  • Case preserving
  • Allowed character set
  • Reserved characters
  • Reserved words
  • Maximum length

On the desktop client, we currently tackle some aspects of allowed character sets (by forcing unicode composition per OS) and allowed characters (by being overly strict with disallowed characters).

danimo avatar Jan 14 '14 11:01 danimo

One thing to consider is that Windows uses the MappedLocal class (instead of the Local class) to handle unicode filenames differently on the local (to server) filesystem. This may be how it manages to keep differently-cased filenames straight on the server side.

That said, I was under the impression that this original bug doesn't have anything to do with collisions based on case-sensitivity. The original bug seemed to be talking about how when you upload "photo.jpg" and "photo.JPG" the files UI shows two files named "photo.jpg". They are different files, but the UI changes the case of the extension for no apparent reason other than maybe it looks nice.

Reference screenshot with offending CSS: image

ringmaster avatar Jan 14 '14 15:01 ringmaster

Ticket#2014010908000325 — Data loss with steps to reproduce problem https://otrs.owncloud.com/otrs/index.pl?Action=AgentTicketZoom;TicketID=63816;ArticleID=100567#

steps to reproduce -User1 & user 2 use a non case sensitive filesystem (i.e Mac HFS+) -User 1: create a new folder, called "shared" -User 2: share any folder with User 1 -User 1 sees a folder "shared" and "Shared" in the WebUI -User 1 uses desktop client to sync to local machine -User 2 also uses desktop client -ownCloud gets confused and eventually removes the shared flag in User 2s folder -User 2 notices this and shares with User 1 again -User 1: desktop sync notices things are strange and starts to move files from "Shared/folder" to "shared/folder" -In the end, the content of the folder is deleted on both users machines.

architecture description

Server configuration: Operating system: Ubuntu 13.04 Web server: Apache 2.4 Database: Postgres 9.2 PHP version: 5.5 ownCloud version: 6.0.0a Updated or fresh install: fresh install List of activated app: LDAP,

Client configuration: Browser: OS X Sync Client 1.4.2 and 1.5.0 Operating system: OS X 10.8.5

dietmaroc avatar Jan 14 '14 18:01 dietmaroc

I removed the confusing lowercase force. Please review https://github.com/owncloud/core/pull/7183

jancborchardt avatar Feb 13 '14 09:02 jancborchardt

We should still continue the discussion about a server-side fix for case-insensitive filesystems.

Since this ticket here was originally about the extension casing in the UI, I opened a new one: https://github.com/owncloud/core/issues/17161

PVince81 avatar Jun 25 '15 08:06 PVince81