rpcclient / srvmgr.exe
Luke Kenneth Casson Leighton
lkcl at switchboard.net
Tue Aug 17 20:58:06 GMT 1999
> > > id : on nt side this is some kind of auto-increment variable, that
> > > increases per connection. Any hints where I can get such a number ?
> >
> > ok, you'll have to create one. the "enumerate" function that reads
> > STATUS..LCK? give it a starting index, and have it "skip" that number of
> > entries, and start from there.
>
> Could that not be easier implemented in the smbd connect code ?
sure. that is a simpler "first" implementation. you just have to make
sure that samba ignores the "recommended buffer size" and returns ALL the
entries in STATUS..LCK.
the "id" is used for connection-termination and for multi-call
(NetrConnectionEnum) enumeration purposes. i.e give me as many as you
can, oh dear i can only give you 100, call NetrConnectionEnum again, give
me the next 100 etc etc.
> > srvmgr isn't doing _any_ counting at all, it's calling MSDN functions that
> > report information from a remote machine. that's the way _all_ of these
> > NT remote admin tools work.
> >
> > > I did not see any rpcclient command to tell how many open files a
> > > share has ?
> >
> > there isn't one: there is no such MSDN call to do this that neither srvmgr
> > calls nor rpcclient can equivalent-call. there _is_ however a srvfiles
> > command which is NetFileEnum() in srvmgr / MSDN.
>
> Hmm .. still have that problem, that srvmgr displays strange values,
> although rpclient values are quite sane.
srvmgr often doesn't display _all_ the info that's obtained from the
Netr*Enum calls.
> I did test a NT ws with rpcclient, and tried to match the output of
> rpcserver the same, but with no success on srvmgr.
interesting.
> Those MSDN functions call the rpc calls, right ?
the MSDN functions usually ARE the rpc calls!!!!!
_sometimes_ they will be "massaged" (e.g MSDN RegConnectRegistry maps to
RegOpenHKU or RegOpenHKLM: there _is_ no MSRPC call RegConnectRegistry) or
passed through an undocumented API, e.g NetUserEnum is an MSDN-level API
which goes through the local security authority and comes out the other
side as a series of \PIPE\samr calls, one of which is SamrEnumUsers.
> (So, my main problem is still : are my generated values sane ?
dude, it almost doesn't matter :-)
> with no reference data, I only have rpcclient to a NT ws, and
> srvmgr.exe. Any other ways to validate my results ?
send some patches, i review and commit them, then you send a message to
samba-tech, "hi anyone want to check this out?" :-) if you broke
anything then i don't get blamed too much :)
More information about the samba-technical
mailing list