AnsweredAssumed Answered

Special characters in Filename using CIFS

Question asked by toltech on Nov 8, 2008
Latest reply on Nov 8, 2008 by toltech
We mount alfresco using a CIFS mount using following command in fstab:
//localhost/alfresco /mnt/alfresco  cifs credentials=/etc/.alfresco,uid=alfresco,gid=alfresco,iocharset=utf8

We now notice some filenames contain '[' or ']'.
However valid names in Alfresco the mentioned characters are unfortunately special characters under Linux.

The problem we have is that we can not "stat" these files.
Can be used, renamed from within a windows explorer mount and also from the web interface. This means there is no way we can prevent users from using these characters.
But from a Linux CIFS mount we get following result:
cp test[2].txt /tmp/a
cp: cannot open `test[2].txt' for reading: No such file or directory

All escaping sequences we can think of also give this error (mind the difference in the open and stat of the error output)
cp test\[2\].txt /tmp/a
cp: cannot stat `test[2].txt': No such file or directory
cp 'test[2].txt' /tmp/a
cp: cannot stat `test[2].txt': No such file or directory
cp 'test\[2\].txt' /tmp/a
cp: cannot stat `test\\[2\\].txt': Invalid argument
cp "test\[2\].txt" /tmp/a
cp: cannot stat `test\\[2\\].txt': Invalid argument

We use this mount to make a filebased backup of the Alfresco repository using rsync and is therefore very valuable to us. Do we need to use special mount options to prevent this? Or is this a deeper problem in Linux file system access.

Any ideas?