Bug 1767 - Long extensions aren't shortened correctly in mangled names
Summary: Long extensions aren't shortened correctly in mangled names
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Docs (show other bugs)
Version: 3.0.7
Hardware: All Windows 2000
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-15 05:38 UTC by Peter Hartley
Modified: 2008-11-11 09:02 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 Peter Hartley 2004-09-15 05:38:39 UTC
man smb.conf (entry "mangled names") says "The first three alphanumeric
characters of the final extension are preserved, forced to upper case and appear
as the extension of the mangled name. The final extension is defined as that
part of the original filename after the rightmost dot."

Samba 3.0.7, at least with hash2 mangling, does not implement this -- so any
mangled *.flac files on a Linux server, such as "Foo?.flac" appear extensionless
on a Windows 2000 client, rather than as the still-usable "*.FLA". The problem
is in name_map() in mangle_hash2.c, where the variable 'dot_p' is used both to
delimit the extension and to record whether the extension is already
3-char-ASCII-kosher. In particular, on line 569 it tries to use dot_p to mangle
a non-kosher extension, but in the non-kosher case dot_p will already have been
zeroed by line 537 or 541. A fix would be to invent a new variable
"should_mangle_whole_name" (or some pithier term), clear it by default, set it
on lines 537 and 541, and test on it (rather than dot_p) at line 560.
Comment 1 TAKAHASHI Motonobu 2004-12-30 08:30:43 UTC
Still not fixed at Samba 3.0.10 against Windows XP client.
(this does not depend on client OSes.)
For example:

-----
S:\Work\Samba\SFN>echo test >  a.aaaa

S:\Work\Samba\SFN>dir /x a.aaaa
2004/12/26  15:52                 7 ALAG78~8     a.aaaa
-----

The extesion of the file should be "aaa."
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-02-07 10:53:08 UTC
updated smb.conf(5).  Removed offending section.
Comment 3 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:16:27 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 4 TAKAHASHI Motonobu 2008-11-11 09:02:21 UTC
Still not fix at Samba 3.0.24 & Samba 3.2.4.