Bug 4317 - Folders with a white space at the end are not displayed correctly.
Folders with a white space at the end are not displayed correctly.
Status: ASSIGNED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.23d
x86 Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-01 10:39 UTC by Simon Wenner
Modified: 2007-01-04 19:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Wenner 2007-01-01 10:39:13 UTC
Create a folder with a white space at the end inside a Samba share under Linux. Then access it over Samba and you see a wrong folder name. Example: "test " is displayed as "TFNZPF~F".
This error also occurs if you view these folders with WinXP.

OS: Debian Testing (Etch), tested with Ubuntu 6.10 and Fedora Core 6 too

Regards 
Simon Wenner
Comment 1 Jeremy Allison 2007-01-01 12:50:49 UTC
Sorry, this is not a bug. Folders ending in white space are not Windows compatible names so we must mangle them, just like we have to mangle names with a ':' character. It's not possible to create such a folder on Windows (it silently truncates the whitespace at the end of the name). I'm closing this out (there have been other similar reports in the past).
Comment 2 Björn Jacke 2007-01-03 06:09:32 UTC
Jeremy: mangling is also done with linux cifs clients which negociated the cifs unix extensions. As CIFS doesn't always equal windows I would say mangling should not be done unconditionally here but only when cifs unix extensions are not used. What do you think?
Comment 3 Volker Lendecke 2007-01-03 09:49:01 UTC
Good point :-)

Volker
Comment 4 Jeremy Allison 2007-01-03 10:47:44 UTC
Correct - for a name ending in space with unix extensions it should not be mangled. I'll look into it - sorry, I thought it was being reported for Windows clients.
Comment 5 Jeremy Allison 2007-01-04 19:21:10 UTC
Ok - what version of the Linux CIFS client code is this ?

In 3.0.23d we have the following code in smbd :

/* Here is where we must switch to posix pathname processing... */
if (client_unix_cap_low & CIFS_UNIX_POSIX_PATHNAMES_CAP) {
            lp_set_posix_pathnames();
            mangle_change_to_posix();
}

The "mangle_change_to_posix()" turns off all mangling for filenames - at this point smbd simply doesn't know how to create mangled names anymore.

The latest CIFSFS client code does negotiate CIFS_UNIX_POSIX_PATHNAMES_CAP - do you haev the source code for the CIFSFS client you're using ?

Jeremy.