zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Bangert <...@groovie.org>
Subject Re: Zookeeper protocol weirdness and pure Python kazoo client
Date Thu, 30 Aug 2012 23:35:03 GMT
On Aug 30, 2012, at 4:00 PM, Ben Bangert <ben@groovie.org> wrote:
> So far, I've found that if I send malformed Auth packets that are missing the auth_type
int, after a few times I can get the Zookeeper server to segfault. I'll attach some more log
scripts and a test script to trigger it next.

If you checkout the pure-python kazoo branch, this script will segfault Zookeeper immediately
on my machine:
import logging

from kazoo.client import KazooClient
from kazoo.protocol.serialization import (
    Auth,
    write_buffer,
    write_string
)

logging.basicConfig(level=logging.DEBUG)


class BadAuth(Auth):
    type = 100

    def serialize(self):
        return (write_string(self.scheme) + write_buffer(self.auth))

k = KazooClient()
k.start()
k._queue.put((BadAuth(0, 'digest', 'user:password'), None))


It apparently really really doesn't like the fact that the auth_type is missing from the payload.
A proper message length is provided though (for the admittedly malformed request), whatever
Zookeeper is doing to read the buffer fails to account for the string being where it expected
the int. Shouldn't this return a marshaling error?

- Ben
Mime
View raw message