Bug 6355 - 8.3 filenames with brackets are mangled in hash2 method
Summary: 8.3 filenames with brackets are mangled in hash2 method
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.34
Hardware: Other Windows XP
: P3 normal
Target Milestone: none
Assignee: Jeremy Allison
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-13 14:38 UTC by Marcin Kierus
Modified: 2009-05-15 12:15 UTC (History)
0 users

See Also:


Attachments
Patch for 3.4.x and above. (1.53 KB, patch)
2009-05-15 12:14 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Kierus 2009-05-13 14:38:58 UTC
8.3 filenames with brackets (and other legal characters) are mangled in "hash2" method. '(' and ')' are legal characters for 8.3 filenames, so filename like TEST(AB).TXT shouldn't be mangled.

Please see below results of "dir /x" command on local drive (C) and samba shared drive (Z)

C:\>dir TEST(A*.TXT /x
2009-05-13  21:11                 0              TEST(AB).TXT

Z:\>dir TEST(A*.TXT /x
2009-05-13  21:10                 0 TX1913~B.TXT TEST(AB).TXT

Legal non alphanumeric characters for 8.3 filename are:

! # $ % & ' ( ) - @ ^ _ ` { } ~

but only _ - $ ~ are considered as legal in Samba 3.x.

"hash" method from Samba 2.2.x is working fine except { and }.
Comment 1 Jeremy Allison 2009-05-13 15:22:10 UTC
This is fixed in 3.2.x and above. 3.0.x is in maintenance mode only.
Jeremy.
Comment 2 Marcin Kierus 2009-05-13 16:07:33 UTC
The same problem still occurs in 3.3.4. 
Comment 3 Jeremy Allison 2009-05-13 16:11:27 UTC
Not reproducible in latest v3-3-test git tree.
Jeremy.
Comment 4 Jeremy Allison 2009-05-13 16:14:16 UTC
Oh wait a minute, I see what you're getting at. The name isn't mangled for the client, but mangled when the short name is *specifically* requested. I'll take a look.
Jeremy.
Comment 5 Jeremy Allison 2009-05-13 16:49:57 UTC
Valid bug - my mistake.
Comment 6 Jeremy Allison 2009-05-15 12:14:15 UTC
Created attachment 4162 [details]
Patch for 3.4.x and above.
Comment 7 Jeremy Allison 2009-05-15 12:15:16 UTC
I've fixed this in 3.4.x and above. The patch would also apply to 3.2.x and 3.3.x but I don't feel comfortable making this change in those releases. I also added a torture test so we don't regress.
Thanks for reporting this !
Jeremy.