Bug 4277 - mounting with "mapchars" also affects filenames with a literal comma
mounting with "mapchars" also affects filenames with a literal comma
Status: RESOLVED FIXED
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
2.6
x86 Linux
: P3 normal
: ---
Assigned To: Steve French
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-03 17:26 UTC by Oliver Burtchen
Modified: 2009-07-27 10:57 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Burtchen 2006-12-03 17:26:36 UTC
Testet against Samba 3.0.21b and Samba 3.0.23d server.


[root@shirkan ~]# uname -a
Linux shirkan.localdomain 2.6.19 #1 Fri Dec 1 17:11:26 CET 2006 i686 athlon i386 GNU/Linux

[root@shirkan ~]# mount -t cifs //hathi/home /mnt -o user=oli
Password:
[root@shirkan ~]# ls -la /mnt/tmp
total 4
drwx------+  2 oli Domain Users  0 Dec  4  2006 .
drwx------+ 36 oli Domain Users  0 Dec  4  2006 ..
-rw-------   1 oli Domain Users 16 Dec  4  2006 foo.bar:1,3
[root@shirkan ~]# ls -la /mnt/tmp/foo.bar\:1\,3
-rw------- 1 oli Domain Users 16 Dec  4  2006 /mnt/tmp/foo.bar:1,3
[root@shirkan ~]# cat /mnt/tmp/foo.bar\:1\,3
test test test
[root@shirkan ~]# umount /mnt


[root@shirkan ~]# mount -t cifs //hathi/home /mnt -o user=oli,mapchars
Password:
[root@shirkan ~]# ls -la /mnt/tmp
ls: /mnt/tmp/foo.bar:1,3: No such file or directory
total 4
drwx------+  2 oli Domain Users  0 Dec  4  2006 .
drwx------+ 36 oli Domain Users  0 Dec  4  2006 ..
-rw-------   1 oli Domain Users 16 Dec  4  2006 foo.bar:1,3
[root@shirkan ~]# ls -la /mnt/tmp/foo.bar\:1\,3
ls: /mnt/tmp/foo.bar:1,3: No such file or directory
[root@shirkan ~]# cat /mnt/tmp/foo.bar\:1\,3
cat: /mnt/tmp/foo.bar:1,3: No such file or directory
[root@shirkan ~]# umount /mnt


Filenames with a literal comma are used by kmail for the mail-folders.


Best regards,
Oli
Comment 1 Shirish S. Pargaonkar 2007-03-08 15:00:55 UTC
I do not think ',' is the problem here, it is ':', one of the characters that 
gets remapped to higher than 0xf000 with unicode.
So a file created with a character like : without mapchars mount options can't
be accessed when the mount is with mapchars option because they are created/represented as two different files on the samba server.
Comment 2 Oliver Burtchen 2007-03-09 21:19:59 UTC
I agree with Shirish S. Pargaonkar, and the explanation for the problem.

Finally thinking I missunderstood the mapchar-option when writing this bug-report. It's intended use is, when you have linux/posix clients (and files with cifs-forbidden letters like :/ ) but _not_ a samba file-server (like windows-shares). Is this right?

If no further comments arrive, I'll close this report in a view days.
Comment 3 Oliver Burtchen 2007-03-09 21:52:46 UTC
Okay, my last comment about the intent of mapchars was not fully correct. I should have read the manpage of mount.cifs twice. Sorry for that.
Comment 4 Shirish S. Pargaonkar 2007-03-12 06:31:06 UTC
As Steve suggested, "If your server supports posix path names/characters - do not use mapchars (we may need to make this more clear in documentation)"

That is the case here I think.
Comment 5 Oliver Burtchen 2007-03-12 19:01:29 UTC
A bit more clarification like the words from Steve in the man-pages would be great. Maybe it should also be stated clearly, that files created when mounting with mapchars may not be accessible from other clients or when mounting without mapchars. So you have to think twice when you move/copy files from a non-posix to a posix file server.
Comment 6 Shirish S. Pargaonkar 2009-05-05 12:03:02 UTC
If a server supports unix extensions but not posix paths
(old samba servers like 3.0.10), mapchars option is needed
to create such a path on the server.

If a server supports unix extensions and posix paths,
(newer samba servers like 3.2.5), mapchars option is not needed
to create such a path on the server.

If a server does not support unix extension 
(Windows server like Windows 2003 Server), mapchars optoin is needed
to create such a path on the server.

By default, a character such as : is not mapped i.e. mapchars
option is off.  But if mapchars mount option is used, even if
a server supports unix extensions, a character such as : is mapped.

A path name created with mapchars mount option with characters
such as : on a share, when that share is mounted without mapchars
mount option, the path is not legible but can not think of a way
to inform the client to use mampchars mount option (except the change
in manpage documentation of mount command which I posted to the cifs
mailing list as a patch).
Comment 7 Jeff Layton 2009-07-27 10:57:32 UTC
Patch to clarify mapchars option is now in samba master branch. Closing as FIXED.