Bug 15838

Summary: [msdosfs] [patch] Conversion tables in msdosfs_conv.c are buggy
Product: Base System Reporter: cejkar <cejkar>
Component: kernAssignee: Tom Rhodes <trhodes>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: jpaetzel
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description cejkar 2000-01-02 15:00:01 UTC
In msdosfs_conv.c there are several implicit conversion tables
which should do conversions between ISO-8859-1 (Unix) and IBM850
(DOS and Windows) character sets.

Patch #1:

0xA0 in Latin1 / 0xFF in CP850 is NO-BREAK SPACE character.
This character is allowed in both DOS and Windows names so mapping
0xA0 -> 0 should be changed to 0xA0 -> 0xFF in unix2dos table
(Latin1 -> CP850) and mapping 0xFF -> 0x3F should be changed to
0xFF -> 0xA0 in dos2unix table (CP850 -> Latin1).

0xB4 in Latin1 / 0xEF in CP850 is ACUTE ACCENT character.
Mapping 0xB4 -> 0xEF in unix2dos table is correct, but mapping
0xEF -> 0x3F should be changed to 0xEF -> 0xB4 in dos2unix table.

Patch #2:

This is fix to possible source of problems with tolower() / toupper()
conversions. Currently table l2u is implemented as tolower() instead
of toupper() (l2u is the same as u2l table) and table unix2dos is
implemented as toupper(L1to850()). The only usage of l2u and unix2dos
tables is consequently in order src -> l2u -> unix2dos -> dst
so conversions work. But if user use in mount_msdos -W parameter
without -L parameter and tables without implicit toupper() conversions, 
he is in troubles. So I think it should be better to implement implicit
tables in more natural form: l2u table as toupper() and unix2dos table
as L1to850() without implicit toupper() conversion - see patch #2.
If removing of implicit toupper() conversion in unix2dos is not
desirable, table l2u should be patched at least.

Fix: Patch #1:

Patch #2:
Comment 1 Tom Rhodes freebsd_committer freebsd_triage 2003-12-06 06:01:30 UTC
Responsible Changed
From-To: freebsd-bugs->trhodes

Grab this PR.