Excel Print to file problem with Samba Shares.

P Ranjit Kumar ranjit at cup.hp.com
Fri Sep 15 00:14:33 GMT 2000


This is my second message regarding the Excel Print to File problem.

Thanks to Jeremy for replying to my previous message. Jeremy suggested that
I fix the problem in nttrans.c. I added a little code to smbd/nttrans.c and
smbd/filename.c so that Samba now looks for invalid chars in a filename
before the file is opened.

Please look at the attached files for the fix. A new function
check_for_invalid_chars(char* ) is added to filename.c and is called from
reply_ntcreate_and_X() in nttrans.c

I would request all the folks out there to check this little code and let me
know if there are any problems with adding this code to Samba.


Note: Here is my previous message on this topic.

> Hello,
> Here is an observed problem with Microsoft Excel when using files on SAMBA
> shares.
> 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
> 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
> is tryed on a NT share, the NT server rejects the "file:" as an invalid
> name (error code is NT_STATUS_OBJECT_NAME_INVALID), then excel prompts for
> 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
> ":" there are a bunch of other characters in NT that make a file name
> invalid. They are \/*?<>|

*               R A N J I T   K U M A R   P E D A P A T I           *
*   Hewlett-Packard Company,       ~  E-Mail   : ranjit at cup.hp.com  *
~   19410 Homestead Road, MS 43UA  ~  Phone (O): 001-408-447-6639   ~
*   Cupertino, CA 95014-9810       ~        (h): 001-650-210-9885   *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ranjit Kumar Pedapati.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20000914/fe1bbf16/RanjitKumarPedapati.vcf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nttrans.c
Type: application/octet-stream
Size: 53116 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20000914/fe1bbf16/nttrans.obj

More information about the samba-technical mailing list