Listing shares

Derrell.Lipman at UnwiredUniverse.com Derrell.Lipman at UnwiredUniverse.com
Wed Jan 29 17:33:43 GMT 2003


Danny Smith <dannys at cinesite.co.uk> writes:

> I've just come across a problem listing shares on both samba and Win* boxes
> using the samba suite.  Initially I tried using 'smbclient -L' and parsing
> the output using a perl script, which works to a degree.  The problem is
> that the V2.x.x smbclient uses the old-style "RAP" calls to talk to the
> server, which are limited to 13 charcter return values.  I overcame this by
> using a V3 'net rpc share' command instead, and discovered that the output
> is limited by the format string in net_rpc.c to 12 characters instead
> (net_rpc.c:1125 and net_rpc.c:1128). Surely this is a little short sighted?
> I've got around the problem for now, by changing the format strings, but
> it's maybe worth looking at a more generic solution?
>
> Personally I think it would be nice to be able to pass a format specifier to
> such commands, for use in these kinds of cases. Does anyone have any views
> on that? Assuming people are agreeable to it, I'm happy to attempt some
> patches...

I submitted patches about six months ago, to provide options to generate
program-parsable output from smbclient and nmblookup.  If you search the
archives, you should find exactly what you're looking for.  I'm not sure
whether the patches were rejected or just never incorporated.

Cheers,

Derrell


More information about the samba-technical mailing list