is "net rpc share" (i.e. NetrShareEnum) clipping share names to 8 bytes?

Rafal Szczesniak mimir at samba.org
Thu Sep 9 06:55:44 GMT 2004


On Wed, Sep 08, 2004 at 03:25:52PM -0700, David Wuertele wrote:
> >> > My app needs to query Windows hosts using the NetrShareEnum RPC.  It
> >> > isn't obvious from the docs whether I can accomplish this with
> >> > the smbclient app or the libsmbclient.so library.  Is this
> >> > implemented?  Where is the API documented?
> >> 
> >> Nowhere, actually :)
> 
> Richard> Well, it would be easier if the libsmbclient (or libsmb) code
> Richard> would call this function at the appropriate point, but it
> Richard> doesn't as far as I am aware.
> 
> I notice that the "net" program has an interface to NetrShareEnum.
> I've been playing with it, and it works, sorta.
> 
> It seems like share names are getting clipped by the net program to 8
> bytes, but I haven't figured out where or why.
> 
> Currently the rpc_client code that the net program links to is only
> output as a statically linkable object (libmsrpc.a).  Will this ever
> be dynamic?

Well, libmsrpc library support isn't complete in the way it is in
libsmbclient. That's why I didn't mention it.

> Richard> This will be much easier in Samba4, I suspect.
> 
> As far as incorporating the NetrShareEnum RPC into my own program in
> the shortest time possible, should I try to use the code in libmsrpc,
> or should I try to get Samba4 and use it?

Sure, you can try. Samba4 does contain srvsvc function stubs. The thing
is if they offer required functionality. It looks like it (metze has
done some work there, afair), but I haven't tested it.

Though name of libsmbclient doesn't suggest it, it includes rpc client
code. Have a look at Makefile what's put into the library. Results of
using 'nm' confirms that.


cheers,
-- 
Rafal Szczesniak
Samba Team member  http://www.samba.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20040909/40db11db/attachment.bin


More information about the samba-technical mailing list