[Samba] PATCH - smbd/trans2.c to support writing to Unix named pipes(FIFO)

Jeremy Allison jra at samba.org
Fri Mar 1 18:53:05 GMT 2002


On Fri, Mar 01, 2002 at 04:07:38PM -0700, Steve Williams wrote:
> 
> We have a Unix named pipe sitting in a Samba shared directory.  We have a
> small C program that runs as a Unix daemon, listening for input from the
> pipe file and performing tasks based on what is written to the pipe file by
> the Windows client.  ( Unix system: mknod some_fifo p )
> 
> The windows clients just see a "file" in a share on the Unix box, open it,
> write to it, close it, and magic, we have a very simple RPC style API that
> works with almost every windows application (including VBScript in MS
> Word!).
> 
> This has been working for years using Windows 9X clients, talking to Samba
> 2.0.x, right up to 2.2.3a.  I have avoided NT clients to date, but
>   error string = Illegal
.....
> The problem is the line that does the vfs_ops.lseek.  The FD is actually a
> pipe which causes an error.
> 
> I have no idea what what a "TRANSACT2_QFILEINFO: level=258" call is
> supposed to do,  but based the fact that it is returning the current offset
> in the file, I am offering the following code as a potential enhancement.

I've actually fixed this differently - I modified the lseek inside
the VFS to silently allow ESPIPE errors to return 0. This should fix
all uses of the vfs lseek as seen by the client. This also allowed
me to tidy up some code in smbd/fileio.c.

As Windows clients are never aware of pipes in the filesystem this
should be completely safe.

Comments anyone ?

Jeremy.




More information about the samba mailing list