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

Steve Williams steve at ware-solutions.com
Fri Mar 1 20:44:02 GMT 2002


Hi Jeremy,

It is interesting, because my first approach was to modify the same
lseek inside of the vfs as well.  That was my preliminary testing, but
I figured the scope of that change was wayyy out of my control.  By
changing the code higher up in the layer, I figured the potential
impact was much more restricted.  However, given that you are one of
the "Gods of Samba", I'll trust that your approach is a "better"
solution.

How recently did you make the change to the vfs lseek routine?

Can you post the diff to 2.2.3a and I will apply it and put it into
production.  

Thanks!

Jeremy Allison wrote:
> 
> 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