Python and Samba

Steve Holden sholden at bellatlantic.net
Fri Feb 11 08:13:40 EST 2000


Radovan Garabik wrote:
> 
> Aahz Maruch <aahz at netcom.com> wrote:
>  : In article <38A33CA3.CD301863 at kpnqwest.no>,
>  : Stein M. Eliassen <steinme at kpnqwest.no> wrote:
>  :>
>  :>I wonder if there is a way to use samba services from python?
>  :>
>  :>What I would like to do is browse shares from Python code.
>  :>Now I have to mount the share in a script before running the my python
>  :>code.
> 
>  : Hmmmm...  I'm doing some WAGing here, but it seems to me that the
>  : fundamental problem is that you really need to have a UNC and/or Win32
>  : environment in order to browse Samba shares.  If you were running Python
>  : on NT, this wouldn't be an issue, I think.  So the fundamental problem
>  : isn't a Samba library per se, but the SMB client for Unix.
> 
> there is a smbclient for unix (and if I am not mistaken, a library too,
> in this case you pobably can SWIG a module....), you have to parse
> smbclient's output... not difficult, just a bit boring.
> 
> --
>  -----------------------------------------------------------
> | Radovan Garabik  http://melkor.dnp.fmph.uniba.sk/~garabik |
> | __..--^^^--..__         garabik @ fmph . uniba . sk       |
>  -----------------------------------------------------------
Recent versions of Samba come with SMBFS, an UNSUPPORTED client-side driver
for SMB which will allow Linux systems to mount SMB shares.  However the
Samba team recommend that you use smbsh, a shell which modifies filename
semantics so that network resources can be accessed as

	/smb/hostname/sharename/...

and this seems to be the way forward ... I'm using the now somewhat
outdated 2.0.4b on my Linux SPARCstation.  The README-smbmount file
concludes a summary of alternative with:

"...	3) Encourage people to use the "smbsh" utility that is part of samba
		and is being developed to replace the need for "SMBFS"
		- this is portable to platforms other than Linux
		- it allows each user to authenticate as themselves instead
		  of allowing all users to use an SMB session that is
                  authenticated as just one user.

We have chosen the later and hope that our users will understand and support
the decision that has been made."

So caveat emptor (except that it's free, so we aren't really emptors).

regards
 Steve

--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list