bugphpGroupWare - Bugs: bug #7303, Case sensitivity problematic in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #7303: Case sensitivity problematic in VFS (SQL)

Submitted by:  Michael Totschnig <totschnig>
Submitted on:  Sat 17 Jan 2004 11:39:23 PM UTC  
 
Item Group: 0.9.16RC2Category: filemanager
Severity: 3 - NormalPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: Lars Piepho <lpiepho>Open/Closed: Open
Component Version: SVNOperating System: GNU/Linux - Debian
Reproducibility: NonePlanned Release: None
Fixed Release: 

Sat 17 Jan 2004 11:39:23 PM UTC, original submission:

Using phpgroupware with MySQl, in filemanage, when you try to rename a file or directory by only changin case (e.g. file.txt to File.txt) the following error is raised:

Warning: unlink(/var/phpgroupware/files/home/michael/File.txt): No such file or directory in /var/www/html/phpgw_16/phpgwapi/inc/class.vfs_sql.inc.php on line 1618

followed by the message telling that file.txt had be renamed to File.txt. But the file is only renamed on the filesystem , it appears from the directory listing, until you use the update function.

The reason for the error, is the SQL query in the file_exists function: Since in MYSQL comparison on text fields is case insensitive, it believes that File.txt exists. Function mv then calls function rm to remove it from the filesytem.

A complete fix to this problem (which also appears in other situations) does not seem to be trivial. Either the VFS must be declared case insensitive, and all directory and file names must be translated to either upper or lower case, or all SQL queries must use functions that are case sensitive. In MySQL, according to the manual, you'd have to use
`INSTR(col_name, "A")=1' or `STRCMP(col_name, "A") = 0', but does this also work in other RDBMS?

Michael Totschnig <totschnig>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Tue 20 Jan 2004 12:08:12 PM UTCpowerstatAssigned toNone=>lpiepho

Back to the top


Powered by Savane 3.1-cleanup1