pysmbc

This page is about the Python bindings for the libsmbclient API from Samba, known as pysmbc. It was written for use with system-config-printer, but can be put to other uses as well.

I work on this module as part of my job at Red Hat.

Download

Download tarball releases from the Python Package Index:
http://pypi.python.org/pypi/pysmbc/

Download older tarball releases from:
http://cyberelk.net/tim/data/pysmbc/

Source Code

Fetch the source code like this:

git clone git://git.fedorahosted.org/git/pysmbc.git

or browse it using gitweb.

There is another git repository for pysmbc at github:

git clone http://github.com/hamano/pysmbc.git

Bug Reporting

Report bugs using the trac interface.

Discussion

Discussion about pysmbc is welcome on the system-config-printer mailing list.

8 Responses to “pysmbc”

  1. Great tool, but I was not able to use it.

    Wow, I’ve submitted ticket #1: https://fedorahosted.org/pysmbc/ticket/1#preview

    I think I’m able to fix it myself, but I know almost nothing about libsmbclient and not sure what smbc_bool actually is.

  2. tim says:

    It’s because you’re using an older version of libsmbclient than pysmbc currently supports.

  3. Yavor says:

    Hi there,
    This is a very useful tool for me, although I am experiencing a problem with version 1.0.10 – when trying to transfer certain non-utf8 files like documents and PDF files, this results in an exception. I have traced down the problem, found a fix, and submitted a ticket at Fedora – please take a look when you have the time – https://fedorahosted.org/pysmbc/ticket/3

    Cheers,
    Yavor

  4. Graeme says:

    Hi,
    This module looks perfect for my needs, but I’m getting build errors, because my libsmbclient.h doesn’t declare smbc_open_fn. Can you document the supported version(s) of libsbmclient ?
    Thanks,
    Graeme

  5. Robert says:

    I’m trying this out on a DFS and seeing an error when trying to navigate to a share where SMB signing is required:

    >>> ctx.stat(“smb://<>/optimus/IronHide”)
    cli_negprot: SMB signing is mandatory and we have disabled it.
    protocol negotiation failed
    Couldn’t resolve \IronHide

    It seems adding “client signing = auto” to my smb.conf file does not fix the error. I don’t see an attribute in the Context object to change. Is there a way to allow SMB Signing with pysmbc?

    Thanks,
    Robert

    • Tim says:

      The only part of the libsmbclient interface that seems relevant is “smbc_set_credentials” which includes a parameter for “signing state” (on/off/force). Maybe I should make that function available.

    • Tim says:

      I just checked in a change to add Context.set_credentials_with_fallback. The function I mentioned earlier seems to be deprecated in favour of this one, although it doesn’t have a parameter about signing state. Might be worth trying out though. Let me know if it helps.

Leave a reply

Comments are moderated. Comments that are inappropriate, offensive, vulgar, badly written or insulting will be deleted or edited to make the author look silly.