Problem with reading file from VFS and Windows

Simo Sorce idra at samba.org
Thu Feb 10 12:22:26 GMT 2005


On Thu, 2005-02-10 at 13:15 +0100, Marek Grac wrote:
> On Thu, 10 Feb 2005, Simo Sorce wrote:
> 
> >> But I still think that when have my_fd_table[] it doesn't change fd_table
> >> in samba. And when I use pread() on fd which is open in my_fd_table[] but
> >> not in system fd_table then it should return error.
> >
> > A) how do you know there isn't another file opened in the fd_table that
> > have the same id of the file opened in your own fd_table?
>  	If there is another file with same fd in fd_table and in
>  	my_fd_table. Then reading from fd can return segments from other
>  	file. I will also accept if it fails and this connection will fail
>  	but problem is that it crashes whole samba server and every share
>  	on it. Then you have to kill (perhaps kill -9) and restart. And
>  	this is what I think is wrong. I'm quite sure that my VFS doesn't
>  	access any samba internal variables, all my interaction is made in
>  	API calls.

So you're proposing that samba should try to defend from itself?
The modules are supposed to be bug free (at least as much a posix
filesystem is :-)

Modules are really a part of samba when loaded so any bug in the module
can easily reflect in samba.

> > B) We just pass the call down to the system. It is the operating system
> > job to return an error if the fd is not really open, it's not a samba
> > job.
>  	Yes, I agree. But error from underlying function should be
>  	catched by samba. And should not segfault samba. If crash
>  	function itself then this is no problem for samba, but in my case
>  	it creshed somewhere in samba.

Errors are all caught AFAIK.
If you can show me a code path where there is a failure on catching an
error condition and that can lead to a segfault, then that's a real bug,
and we will be glad to fix that.

> > C) You must implement your module as OPAQUE in your case. With type
> > opaque calls are not forwarded to the operating system but dies in your
> > module, as forwardnig them to the operating system just make no sense at
> > all.
>  	Yes, I know it. In this case several functions where missing

In this case you may expect Windows workstation to have some problems.

Simo.

-- 
Simo Sorce    -  idra at samba.org
Samba Team    -  http://www.samba.org
Italian Site  -  http://samba.xsec.it


More information about the samba-technical mailing list