Re: [BUG] storage.xml: owner|group=-1 → 2^32-1 on 32 Bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/23/12 15:17, Philipp Hahn wrote:
> Hello,
> 
> when you install and use libvirt in a 32 bit environment, the handling of 
> owner and group in /etc/libvirt/storage/*.xml is broken: The initial -1 is 
> printed as an "unsigned int" and is thus converted to +(2^32-1):
...
> 
> When you next restart libvirtd virStorageDefParsePerms() tries to parse that 
> as an "signed int", which fails in virXPathLongBase() because of
>> 182             if (*value != obj->floatval) {
>> (gdb) print *value
>> $11 = -2147483648
>> (gdb) print obj->floatval
>> $12 = 4294967295
>> (gdb) print /x *value
>> $13 = 0x80000000
>> (gdb) print /x obj->floatval
>> $14 = 0xffffffff
> 
> This then prints the following error messages:
>> 2012-11-23 14:03:18.877+0000: 25536: error : virStorageDefParsePerms:613 :
>> XML error: malformed owner element
>> 2012-11-23 14:03:19.581+0000: > 25529: error : 
> storagePoolSetAutostart:1056 : Failed to create symlink
>> '/etc/libvirt/storage/autostart/default.xml' to '/etc/libvirt/storage/def
> 
> The change to print owner and group as %d instead of %u was introdeces in 
> commit 37a10129:
>> Update xml schemas according to libvirt source
> ...
>> storage_conf: Print uid_t and gid_t as signed to storage pool XML.
> 
> Care to revert that change? Patch is attached.
> 
> Sincerely
> Philipp
> 
> 
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Hello,

originally the type and owner were stored in an int and printed as a
signed int (%d). Commit 3e2c3d8 changed the type to uid_t/gid_t, commit
8768149 (both pre-0.9.11) changed the printing format to unsigned (%u).

The change you asked to revert (part of 37a10129, pre-0.10.1) changed
the format back to %d, to prevent writing 2^32-1 instead of -1.

Jan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]