On Friday 08 May 2009 14:54:08 Holger Mueller wrote:
> Hi,
>
> I've the intention to connect to bacula-dir in pure Python
> using Python's library modules.
> But I run in trouble with the hmac/base64 implementation,
> which seems to be different from bacula ones.
>
> Code Sniplet:
> ----8><-----------8><----
>
> HELLO = r"Hello %s calling\n"
> ...
> def login(self, username, password):
> pw = md5.md5(password).hexdigest()
>
> self._send(self.HELLO % username)
> response = self._recv()
>
> m = self.RXP_RESP.search(response)
> print m.group("challenge")
> challenge = hmac.new(m.group("challenge"), pw).digest()
> self._send(base64.b64encode(challenge.digest())[:-2] + "\n")
> print self._recv()
>
> ----8><-----------8><----
>
> self._send and self._recieve add/strip the datalength prefix on socket
> data stream.
> Any suggestions?
Off hand, I would say that your first problem is that you are not using the
Bacula network protocol, which is described in the Network chapter of the
developer's manual -- you need to read the small print.
Kern
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel