[Samba] python: listing samba shares

Igor Katson descentspb at gmail.com
Sun Aug 16 08:54:57 MDT 2009


Ricardo Jorge wrote:
> Hi,
>
> Here is some code to get you going. Try it out.
>
>   
Thanks for the quick answer. As far as I understand, this snippet of 
code parses smb.conf and prints your shares (i don't have an smb.conf 
for samba4 yet, and btw, found a segfault while trying to do samba_lp).

But what I need, is to list remote shares through the network, provided 
a host, and, optionally, a port. Is it possible?

As for that segfault:
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import samba.param
 >>> obj = samba.param.LoadParm()
 >>> obj.[Here I press tab-tab, for readline autocompletion]
Segmentation fault



More information about the samba mailing list