> When just launching your code (with provided credentials), I have a segfault.
> With the credentials code snippet removed, everything > works fine, and I can
> see the shares listing! But when changing "localhost" to another ip address
> (a windows machine), it fails:
About the segfault, I don't know why it happens. I found that it
happened (and already reported it) when creds.set_workstation was
omitted. I don't know what it could be in your situation.
Try this code instead. I changed the transport type to ncacn_ip_tcp.
It seems that you didn't need the credentials to do the smbclient
listing so you can also try removing them from there.
conn = srvsvc.srvsvc('ncacn_ip_tcp:192.168.1.68', credentials=creds)
except Exception, msg:
ctr = srvsvc.NetShareInfoCtr()
shares = conn.NetShareEnumAll(u'192.168.11.68', ctr, 0, 0)
print "There are " + str(shares.ctr.count) + " shares"
for i in range(0, shares.ctr.count):
share_info = info =
conn.NetShareGetInfo(u'192.168.1.68', shares.ctr.array[i].name, 2)
print share_info.name + "\t" + share_info.path + "\t "
> I would like to list remote samba shares contents (most of which are windows
> machines), not the local ones. So os.listdir() cannot help here.
You're correct, I forgot about that detail :) I couldn't find a
binding for this in the Python library.
To unsubscribe from this list go to the following URL and read the