Excel Print to file problem with Samba shares.

P Ranjit Kumar ranjit at cup.hp.com
Fri Jul 21 22:23:42 GMT 2000


Here is an observed problem with Microsoft Excel when using files on SAMBA

When a Excel's working directory is changed to the drive to which SAMBA
share is mapped (To do this, just open excel, File->New, Type something,
Click on save, in the save as window change the directory to samba share,
then click on cancel.)

Now, if you try to print to a file, Excel doesn't prompt you for a file name
and prints the file to a file named "file:" on the samba share.

The reason is Excel sends NTCreate message with filename "file:", Since
"file:" is a valid name on Unix Samba just accepts it. If the same operation
is tryed on a NT share, the NT server rejects the "file:" as an invalid file
name (error code is NT_STATUS_OBJECT_NAME_INVALID), then excel prompts for a
new filename to be entered by the user. I have tested this behavior.

Samba "open file" needs to work around this defect. Along with the charater
":" there are a bunch of other characters in NT that make a file name
invalid. They are \/*?<>|

I changed  open_file_shared function in smbd/open.c to return an error if
the file contains a ":",  it then works fine. So may be Samba should be
checking for the filename sufficiency. I like to know what the Samba
developers out there think about it.

Okay .. don't hesitate to mail me for more details.


Email: ranjit at cup.hp.com

More information about the samba-technical mailing list