]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind: decode empty string in conf_parse_argv() correctly 6711/head
authorJosh Durgin <jdurgin@redhat.com>
Thu, 26 Nov 2015 05:37:23 +0000 (21:37 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Thu, 26 Nov 2015 05:42:01 +0000 (21:42 -0800)
commitf76d5d6fe6a9f92b1ec17191f5504e2f61e0ff28
tree3aa98932fbfdf76fa70db921d209ba3f8d5a2bc2
parent7ce223ec0f4906a9dee688af1d3c16ecf6a52be9
pybind: decode empty string in conf_parse_argv() correctly

cretargs is a array of c_char_p, which means ctypes has already
converted it to python byte strings. decode_cstr() would misinterpret
the empty string as a NULL c_char_p(), and convert it to None by
accident, resulting in errors when running commands like
'ceph config-key put foo ""'.

Since this is the only place we use arrays of c_char_p, just decode
it directly in conf_parse_argv(). Tested with python 2 and 3.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/pybind/rados.py
src/test/pybind/test_rados.py