[libvirt] [PATCH 4/4] storage: fix uid_t|gid_t handling on 32 bit Linux
Michal Privoznik
mprivozn at redhat.com
Mon Feb 25 14:58:50 UTC 2013
On 22.02.2013 17:55, Philipp Hahn wrote:
> uid_t and gid_t are opaque types, ranging from s32 to u32 to u64.
>
> Unfortunately libvirt uses the value -1 to mean "current process", which
> on Linux32 gets converted to ALLONE := +(2^32-1) = 4294967295.
>
> Different libvirt versions used different formatting in the past, which
> break one or the other parsing function:
> virXPathLong(): (signed long)-1 != (double)ALLONE
> virXPathULong(): (unsigned long)-1 != (double)-1
>
> Roll our own version of virXPathULong(), which also accepts -1, which is
> silently converted to ALLONE.
>
> For output: do the reverse and print -1 instead of ALLONE.
>
> Signed-off-by: Philipp Hahn <hahn at univention.de>
> ---
> src/conf/storage_conf.c | 74 ++++++++++++++++++++++++++++++++++++++---------
> 1 file changed, 60 insertions(+), 14 deletions(-)
>
This one breaks storagevolxml2xmltest:
TEST: storagevolxml2xmltest
1) Storage Vol XML-2-XML vol-file ... OK
2) Storage Vol XML-2-XML vol-file-backing ... OK
3) Storage Vol XML-2-XML vol-qcow2 ... OK
4) Storage Vol XML-2-XML vol-partition ... OK
5) Storage Vol XML-2-XML vol-logical ... OK
6) Storage Vol XML-2-XML vol-logical-backing ... OK
7) Storage Vol XML-2-XML vol-sheepdog ...
Offset 283
Expect [4294967295</owner>
<group>4294967295]
Actual [-1</owner>
<group>-1]
... FAILED
However, the first 3 patches are correct. Even though it's freeze, they are pure bugfixes so I've pushed them.
Michal
More information about the libvir-list
mailing list