Luke Kenneth Casson Leighton
lkcl at samba.org
Mon Jun 26 12:50:02 GMT 2000
findfirst / next / close - the latest ops now working!
so that makes:
- negprot (LM 0.12 only)
- sesssetupX (parses, no auth so all ops are root)
- openX, readX, writeX, close
trans - lanman:
trans2 - fileops:
- FindFirst2 (info 0x104)
- FindNext2 (info 0x104)
- QueryFSInfo (info 0x105)
- getattrE (only one info level)
this is a fairly radical, "clean" approach i'm taking. aside from the
auto-generated code, the largest .c file, aside from those borrowed from
samba source, is 204 lines long, in each of which, the GPL license takes
so, aside from there being lots of files, it's really obvious what's going
on as the auto-generated code dealing with the over-the-wire stuff is
completely separated from the actual job of being a "server".
despite the obvious complexity and mess of dealing with the SMB protocol,
this stuff is actually quite a pleasure to work with.
there is a smb-vfs-redirector layer added in on all main SMB operations
(open,close,read,write,trans,trans2 only at moment) and i currently have
an independent smb-file-redirector, smb-IPC$-redirector and
smb-print-redirector. smb-print says "unsupported" at the mo. smb-IPC$
only supports trans, for LANMAN operations. smb-file supports rwoc +
trans2 because you need Trans2FindFirst.
there is a PHANDLE object with which a void* and a free-function can be
associated (and it can also be associated with a parent PHANDLE). closing
a PHANDLE has the effect of calling the free-funtion on the void* *and*
calling the close-handle on all child objects.
sounds weird? maybe, maybe not :) it means that the implementation of
SMBtdis is like this:
pTconHnd = find_tcon_hnd_by_index(pSesssetupHnd, SMB_HDR->tid))
well *duur*, how simple is that??? :)
this will have the effect of calling, for each child-file-handle, the
close_policy_hnd() operation, which will call close(state->filedescriptor)
and when i have locking etc it will do the unlocking too, and also get rid
of change-notify events which will _also_ be handles, etc etc.
maybe i will do locking next, although i would like to have notepad
opening / saving a file, first: it does weird stuff like
trans2-query-fs-info requests and getattrs that i don't support yet.
interesting to see what i can "get away with" not supporting, and see what
breaks and what works. e.g i don't return 8.3 mangled file names in the
findfirst/findnext lists tee hee :)
authentication hasn't been added yet, The Plan Is to use TNG code on
loop-back for both authentication and any DCE/RPC requests just get passed
_straight_ through, no questions asked (like they are in TNG at the
so, i do not link in the SMB client library into conifersd at the moment,
and i plan to make sure it stays that way unless there is a really
compelling reason to do otherwise. and at the moment, there isn't one.
things i am definitely not going to consider supporting:
- security = share
things i am going to consider supporting under duress or will be happy to
accept patches for:
- win95 - plaintext passwords
things to support if they are needed:
- SMBsearch (8-bit, DOS-variant of Trans2FindFirst needed even, as andrew
mentioned, for DOS-apps running on NT)
quite a lot achieved in a short space of time. hindsight and most of the
work done through using a spec is a great benefit.
<a href=" mailto:lkcl at samba.org" > Luke Kenneth Casson Leighton </a>
<a href=" http://cb1.com/~lkcl" > Samba and Network Development </a>
<a href=" http://samba.org" > Samba Web site </a>
ISBN1578701503 DCE/RPC over SMB: Samba and Windows NT Domain Internals
More information about the samba-technical