Bug 3792 - Retrieve files with a space character after the namefile fails
Summary: Retrieve files with a space character after the namefile fails
Status: RESOLVED DUPLICATE of bug 7001
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.14a
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 11255
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-20 18:15 UTC by Marco
Modified: 2021-06-28 18:01 UTC (History)
2 users (show)

See Also:


Attachments
Packet capture while trying to create filename ending with spaces on Samba share (3.36 KB, text/plain)
2007-06-14 02:10 UTC, Arvind Deshpande
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco 2006-05-20 18:15:32 UTC
When a file with a space (%20) exists after the filename in the share all file operations fails on non Linux clients.
Example:
smb://share/CAPA-ARTEFINALGESTAO.cdr_ <-- ( _ = white space)
Properties report file size of 0 bytes instead of 245590 on M$ clients. Delete is also imposible.
Is possible fix it trimming the white space, but only at the server side.
Is also possible make a patch to trim it automatically?
Comment 1 Arvind Deshpande 2007-06-14 02:07:01 UTC
(In reply to comment #0)
> When a file with a space (%20) exists after the filename in the share all file
> operations fails on non Linux clients.
> Example:
> smb://share/CAPA-ARTEFINALGESTAO.cdr_ <-- ( _ = white space)
> Properties report file size of 0 bytes instead of 245590 on M$ clients. Delete
> is also imposible.
> Is possible fix it trimming the white space, but only at the server side.
> Is also possible make a patch to trim it automatically?
> 
Following is information from link 
http://msdn2.microsoft.com/en-us/library/aa365247.aspx
    * Do not end a file or directory name with a trailing space or a period. Although the underlying file system may support such names, the operating system does not. You can start a name with a period (.).
   Essentially windows does not like filenames ending with spaces. In explorer if you try creating file "hello    " it creates one as "hello" by truncating trailing spaces. Taking a wild guess that explorer or programs are truncating these does not seem to be true.
  I wrote small console program to create an empty file. If I run the program by pasing it filename ending with spaces windows still truncates it.
  But if SAMBA share is cifs mounted on Linux using same program it is possible to create files ending with spaces. IMHO this should not be allowed.
  Further on samba share if you have 2 files "hello    " and "hello" explorer does show the spaces but if you try opening "hello    " it always opens file without the ending spaces as it sends requests to samba for "hello" and not for "hello    "


Comment 2 Arvind Deshpande 2007-06-14 02:10:14 UTC
Created attachment 2755 [details]
Packet capture while trying to create filename ending with spaces on Samba share

Samba share is mounted on Windows 2K. A program which creates empty file is ran with a command line argument ( a filename to be created ) with filename ending with spaces.
  Evident from the packet capture that Windows sends filename by truncating trailing spaces.
Comment 3 Björn Jacke 2021-06-28 18:01:02 UTC

*** This bug has been marked as a duplicate of bug 7001 ***